URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/g++.dg/template
- from Rev 301 to Rev 338
- ↔ Reverse comparison
Rev 301 → Rev 338
/explicit-args3.C
0,0 → 1,12
// PR c++/37177 |
|
template <class T> |
struct A { }; |
|
template <class T> |
void operator+(T, T); // { dg-error "class or enum" } |
|
int main() |
{ |
operator+<int>; // { dg-error "cannot resolve" } |
} |
explicit-args3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vla1.C
===================================================================
--- vla1.C (nonexistent)
+++ vla1.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/29226
+// { dg-options "" }
+
+template
+static int label (int w)
+{
+ sizeof(int[w]);
+}
+int a = label(1);
vla1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access13.C
===================================================================
--- access13.C (nonexistent)
+++ access13.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: Francesco Monica
+
+// PR c++/13262: Access checking during instantiation of static data
+// member.
+
+template class Aclass {
+ private:
+ Aclass() {}
+ static Aclass instance;
+};
+
+template Aclass Aclass::instance;
+
+template class Aclass;
access13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash42.C
===================================================================
--- crash42.C (nonexistent)
+++ crash42.C (revision 338)
@@ -0,0 +1,10 @@
+// { dg-do compile }
+
+// PR c++/22153
+
+template void foo();
+
+template struct A
+{
+ template<> friend void foo<0>(); // { dg-error "" }
+};
crash42.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef33.C
===================================================================
--- typedef33.C (nonexistent)
+++ typedef33.C (revision 338)
@@ -0,0 +1,21 @@
+// Origin PR c++/43800
+// { dg-do compile }
+
+template
+struct V
+{
+ typedef T t_type;
+};
+
+template
+class J
+{
+ typedef typename V::t_type t_type;
+ const t_type& f(); // #0:
+private:
+ t_type b;
+};
+
+template
+const typename V::t_type& J::f() {return b;} // #1
+
typedef33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash25.C
===================================================================
--- crash25.C (nonexistent)
+++ crash25.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/18124
+
+template class class> class A {}; // { dg-error "" }
crash25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef16.C
===================================================================
--- typedef16.C (nonexistent)
+++ typedef16.C (revision 338)
@@ -0,0 +1,27 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/26693
+// { dg-do compile }
+
+struct C0
+{
+};
+
+template
+struct C1
+{
+ typedef C0 TypedefedC0;
+
+ template
+ void foo (TypedefedC0 *, W)
+ {
+ }
+
+ template C1 (W w)
+ {
+ TypedefedC0 c;
+ foo (&c, w);
+ }
+
+};
+C0 c0;
+C1 c1 (&c0);
typedef16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename5.C
===================================================================
--- typename5.C (nonexistent)
+++ typename5.C (revision 338)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+// Origin: ariels@compugen.co.il
+
+// PR c++/2513: typename handling when scope is dependent as
+// described in DR108.
+
+template struct Select {
+ typedef int Result;
+};
+
+template class Pred> struct FindType {
+ typedef typename Select::Result Result;
+};
+
+template struct Int {
+ template struct RightSize {};
+ typedef typename FindType::Result type;
+};
typename5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: union1.C
===================================================================
--- union1.C (nonexistent)
+++ union1.C (revision 338)
@@ -0,0 +1,29 @@
+// { dg-do run }
+
+extern "C" void abort ();
+
+void g (char c)
+{
+ if (c != 'a')
+ abort ();
+}
+
+void h (int i)
+{
+ if (i != 3)
+ abort ();
+}
+
+template void f(T const &t)
+{
+ union { char c; T t_; };
+
+ c = 'a';
+ g (c);
+ t_ = 3;
+ h (t_);
+}
+
+int main () {
+ f (3);
+}
union1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new2.C
===================================================================
--- new2.C (nonexistent)
+++ new2.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/21336
+
+typedef __SIZE_TYPE__ size_t;
+template void* operator new( size_t Size, _T&);
+struct B {
+ int a;
+ int* m() {
+ return new(a) int;
+ }
+};
+B* n() {
+ return new B();
+}
+
new2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend50.C
===================================================================
--- friend50.C (nonexistent)
+++ friend50.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/34399
+template struct X
+{
+ void foo();
+};
+
+struct Y {
+ template friend void X::X::foo(); // { dg-error "declared as friend" }
+};
friend50.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend33.C
===================================================================
--- friend33.C (nonexistent)
+++ friend33.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// PR c++/18733: Validation of template headers in friends
+
+template struct A
+{
+ void foo();
+};
+
+struct B
+{
+ friend void A<0>::foo();
+};
friend33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend16.C
===================================================================
--- friend16.C (nonexistent)
+++ friend16.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/9602: Inline friend/pure virtual tree data sharing in
+// class template.
+
+template struct X {
+ void foo (X);
+ friend void bar () {}
+};
+
+template
+void X::foo (X x) {}
+
+template struct X;
friend16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28301.C
===================================================================
--- pr28301.C (nonexistent)
+++ pr28301.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/28301
+// { dg-do compile }
+
+template struct A
+{
+ template void foo()
+}; // { dg-error "initializer" }
+
+template<> struct A
+{
+ template void foo();
+};
+
+void bar()
+{
+ A a;
+ a.foo<0>();
+}
pr28301.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator5.C
===================================================================
--- operator5.C (nonexistent)
+++ operator5.C (revision 338)
@@ -0,0 +1,14 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Dec 2004
+
+// PR 18803: reject legal
+// Origin: Wolfgang Bangerth
+
+struct A {
+ int operator() ();
+};
+
+template void foo () {
+ A &a = *new A();
+ const int i = a();
+}
operator5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp19.C
===================================================================
--- ttp19.C (nonexistent)
+++ ttp19.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/27689
+
+void f (...);
+template class F, typename T> void f (F);
+template struct foo { struct bar {}; };
+void g (foo::bar x) { f(x); }
+
ttp19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: redecl3.C
===================================================================
--- redecl3.C (nonexistent)
+++ redecl3.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/19980
+// Origin: Volker Reichelt
+
+// { dg-do compile }
+
+int foo; // { dg-error "previous declaration" }
+template void foo() {} // { dg-error "redeclared" }
redecl3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: param1.C
===================================================================
--- param1.C (nonexistent)
+++ param1.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/22233
+// Origin: Volker Reichelt
+// { dg-do compile }
+
+template struct A
+{
+ A();
+};
+
+template A::A() {} // { dg-error "got 2|but 1 required" }
+
+A<0> a;
param1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: meminit1.C
===================================================================
--- meminit1.C (nonexistent)
+++ meminit1.C (revision 338)
@@ -0,0 +1,8 @@
+// { dg-options "-std=gnu++98" }
+template
+struct S
+{
+ S() : S() {} // { dg-error "base" }
+};
+
+S s; // { dg-message "instantiated" }
meminit1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init2.C
===================================================================
--- init2.C (nonexistent)
+++ init2.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/9820
+
+template struct X {
+ template static int test(...);
+ template static int test(int *);
+
+ static const int i = sizeof(X::template test(0));
+};
+
+template class X;
init2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef9.C
===================================================================
--- typedef9.C (nonexistent)
+++ typedef9.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/34846
+
+template struct __are_same { enum { __value = 0 }; };
+template struct __are_same<_Tp, _Tp> { enum { __value = 1 }; };
+template struct __enable_if { };
+template struct __enable_if<_Tp, true> { typedef _Tp __type; };
+template class __normal_iterator {
+public:
+ __normal_iterator();
+ template
+ __normal_iterator(
+ const __normal_iterator<_Iter, typename __enable_if<_Container,
+(__are_same<_Iter, typename _Container::pointer>::__value) >::__type>& __i)
+ { }
+};
+template class vector {
+public:
+ typedef _Tp* pointer;
+ typedef __normal_iterator > iterator;
+};
+void test() {
+ typedef int t;
+ vector::iterator x;
+ vector::iterator y = x;
+}
typedef9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static11.C
===================================================================
--- static11.C (nonexistent)
+++ static11.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/19826
+
+template struct A
+{
+ static const T i = 1;
+ char a[i];
+};
+
static11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg1.C
===================================================================
--- arg1.C (nonexistent)
+++ arg1.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2003
+
+// PR 9978. We rejected a constant expression.
+
+enum { val = 1 };
+
+template
+struct Bar
+{
+ static const int A = val;
+ static const int B = A + 1;
+};
arg1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error20.C
===================================================================
--- error20.C (nonexistent)
+++ error20.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/25439
+
+template struct A;
+template<> int A<0>; // { dg-error "invalid" }
error20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec11.C
===================================================================
--- spec11.C (nonexistent)
+++ spec11.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: jhbrown@bluefinrobotics.com
+
+// PR c++/13635: ICE explicit specialization of member function template
+
+template
+class bar {
+public:
+ template
+ int func(baz *x);
+};
+
+template <>
+template
+int bar::func(baz *x) { return 5;}
+
+template <>
+template <>
+int bar::func(int *x) { return 5;}
spec11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo7.C
===================================================================
--- repo7.C (nonexistent)
+++ repo7.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/34340
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+struct A
+{
+ int a;
+};
+
+template struct D
+{
+ static const A b;
+};
+
+template const A D::b = { 2 };
+template class D;
+
+const A *x = &D::b;
+
+int
+main ()
+{
+}
repo7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp11.C
===================================================================
--- qualttp11.C (nonexistent)
+++ qualttp11.C (revision 338)
@@ -0,0 +1,23 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do link }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> struct X
+{
+ TT y;
+};
+
+template struct C
+{
+ X x;
+};
+
+int main()
+{
+ C c;
+}
qualttp11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: offsetof1.C
===================================================================
--- offsetof1.C (nonexistent)
+++ offsetof1.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// PR c++/17221
+
+#include
+
+template struct Bar;
+template <> struct Bar<3> {};
+
+template
+struct Foo {
+ Bar k;
+};
+
+struct A { int a; };
+
+template struct Foo;
offsetof1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ref2.C
===================================================================
--- ref2.C (nonexistent)
+++ ref2.C (revision 338)
@@ -0,0 +1,27 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jan 2005
+
+// PR 19298: Rejects legal
+// Origin: Andrew Pinski
+
+struct t
+{
+ void f() const;
+};
+
+template
+struct A
+{
+ static t const& c;
+};
+
+template
+void g(void)
+{
+ A<_Tp>::c.f();
+}
+
+void h(void)
+{
+ g();
+}
ref2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload7.C
===================================================================
--- overload7.C (nonexistent)
+++ overload7.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-do run }
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Oct 2005
+
+// PR 24386:Wrong virtual function called
+// Origin: Scott Snyder snyder@fnal.gov
+
+struct A
+{
+ virtual int Foo () { return 1; }
+};
+struct B : public A
+{
+ virtual int Foo () { return 2; }
+};
+
+template
+int Bar (T *a)
+{
+ if (static_cast(a)->A::Foo () != 1)
+ return 1;
+ if (static_cast(a)->Foo () != 2)
+ return 2;
+ return 0;
+}
+
+int main ()
+{
+ return Bar (new B);
+}
overload7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash51.C
===================================================================
--- crash51.C (nonexistent)
+++ crash51.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/26496
+
+template< typename _Generator> int generate_n(_Generator __gen);
+struct Distribution { };
+typedef double (Distribution::* Pstd_mem)();
+int main(void)
+{
+ Distribution* rng;
+ Pstd_mem ptr;
+ generate_n(rng->*ptr); // { dg-error "non-static member" }
+}
crash51.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash34.C
===================================================================
--- crash34.C (nonexistent)
+++ crash34.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+// PR c++/20028
+
+// We used to crash when referencing TYPE_SIZE_UNIT of the messed-up
+// type used for x, because it was not initialized.
+
+class Foo;
+
+template class Foo { }; // { dg-error "not a template type" }
+
+Foo x; // { dg-error "not a template|incomplete type" }
crash34.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr5.C
===================================================================
--- dependent-expr5.C (nonexistent)
+++ dependent-expr5.C (revision 338)
@@ -0,0 +1,114 @@
+// { dg-do compile }
+
+// Copyright 2005 Free Software Foundation
+// contributed by Alexandre Oliva
+// inspired in the failure reported in Red Hat bugzilla #168260.
+
+template void bind(F f) {}
+
+template void bindm(F f) {}
+template void bindm(F (T::*f)(void)) {} // { dg-message "note" }
+
+template void bindn(F f) {}
+template void bindn(F (*f)(T)) {}
+
+template void bindb(F f) {}
+template void bindb(F (*f)(T)) {} // { dg-message "note" }
+template void bindb(F (T::*f)(void)) {} // { dg-message "note" }
+
+struct foo {
+ static int baist;
+ int bait;
+ void barf ();
+ static void barf (int);
+
+ struct bar {
+ static int baikst;
+ int baikt;
+ void bark ();
+ static void bark (int);
+
+ bar() {
+ bind (&baist);
+ bind (&foo::baist);
+ bind (&bait); // { dg-error "nonstatic data member" }
+ bind (&foo::bait);
+
+ bind (&baikst);
+ bind (&bar::baikst);
+ bind (&baikt); // ok, this->baikt
+ bind (&bar::baikt);
+
+ bind (&barf); // { dg-error "no matching function" }
+ bind (&foo::barf); // { dg-error "no matching function" }
+
+ bindm (&barf); // { dg-error "no matching function" }
+ bindm (&foo::barf);
+
+ bindn (&barf);
+ bindn (&foo::barf);
+
+ bindb (&barf);
+ bindb (&foo::barf); // { dg-error "ambiguous" }
+
+ bind (&bark); // { dg-error "no matching function" }
+ bind (&bar::bark); // { dg-error "no matching function" }
+
+ bindm (&bark); // { dg-error "no matching function" }
+ bindm (&bar::bark);
+
+ bindn (&bark);
+ bindn (&bar::bark);
+
+ bindb (&bark);
+ bindb (&bar::bark); // { dg-error "ambiguous" }
+ }
+ };
+
+ template
+ struct barT {
+ static int baikst;
+ int baikt;
+ void bark ();
+ static void bark (int);
+
+ barT() {
+ bind (&baist);
+ bind (&foo::baist);
+ bind (&bait); // { dg-error "nonstatic data member" }
+ bind (&foo::bait);
+
+ bind (&baikst);
+ bind (&barT::baikst);
+ bind (&baikt); // ok, this->baikt
+ bind (&barT::baikt);
+
+ bind (&barf); // { dg-error "no matching function" }
+ bind (&foo::barf); // { dg-error "no matching function" }
+
+ bindm (&barf); // { dg-error "no matching function" }
+ bindm (&foo::barf);
+
+ bindn (&barf);
+ bindn (&foo::barf);
+
+ bindb (&barf);
+ bindb (&foo::barf); // { dg-error "ambiguous" }
+
+ bind (&bark); // { dg-error "no matching function" }
+ bind (&barT::bark); // { dg-error "no matching function" }
+
+ bindm (&bark); // { dg-error "no matching function" }
+ bindm (&barT::bark);
+
+ bindn (&bark);
+ bindn (&barT::bark);
+
+ bindb (&bark);
+ bindb (&barT::bark); // { dg-error "ambiguous" }
+ }
+ };
+
+ bar bard;
+ barT bart;
+} bad;
dependent-expr5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef25.C
===================================================================
--- typedef25.C (nonexistent)
+++ typedef25.C (revision 338)
@@ -0,0 +1,43 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/42225
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+template
+struct A
+{
+ typedef T I;
+ static const char *i;
+};
+
+template
+struct B
+{
+ typedef T TT;
+ typedef decltype(TT::i) TT_I0;
+ typedef decltype(&TT::i) TT_I1;
+ typedef decltype(*TT::i) TT_I2;
+ typedef A TA0;
+ typedef A TA1;
+ typedef A TA2;
+};
+
+template
+void
+foo()
+{
+ typedef T TT;
+ typedef decltype(TT::i) TT_I0;
+ typedef decltype(&TT::i) TT_I1;
+ typedef decltype(*TT::i) TT_I2;
+ typedef A TA0;
+ typedef A TA1;
+ typedef A TA2;
+}
+
+int
+main()
+{
+ foo >();
+}
+
typedef25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash17.C
===================================================================
--- crash17.C (nonexistent)
+++ crash17.C (revision 338)
@@ -0,0 +1,19 @@
+template
+struct A {
+};
+
+template
+struct B {
+ typedef typename T::type type;
+ static const type j = T::j;
+
+ A b;
+};
+
+struct C {
+ typedef int type;
+ static const int j = 3;
+};
+
+int i = B::j;
+
crash17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit8.C
===================================================================
--- explicit8.C (nonexistent)
+++ explicit8.C (revision 338)
@@ -0,0 +1,13 @@
+namespace N {
+ template
+ struct S {
+ void f() {}
+ };
+ namespace I {
+ template void S::f(); // { dg-error "namespace" }
+ }
+}
+
+namespace K {
+ template void N::S::f(); // { dg-error "namespace" }
+}
explicit8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error1.C
===================================================================
--- error1.C (nonexistent)
+++ error1.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jun 2003
+
+// PR c++ 10219. ICE
+
+template void make_pair(T x);
+
+void foo(){
+ struct fps_chan_ID fps; // { dg-error "incomplete" "" }
+ make_pair(fps); // { dg-bogus "no matching function" "" }
+}
error1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cast1.C
===================================================================
--- cast1.C (nonexistent)
+++ cast1.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Dec 2004
+
+// PR 18949. Forgot to convert from reference.
+// Origin: Volker Reichelt
+
+struct A
+{
+ void foo();
+};
+
+template void bar(A& a)
+{
+ const_cast(a).foo();
+ static_cast(a).foo();
+ reinterpret_cast(a).foo();
+ ((A&)a).foo();
+}
+
+template void bar<0>(A& a);
cast1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp1.C
===================================================================
--- qualttp1.C (nonexistent)
+++ qualttp1.C (revision 338)
@@ -0,0 +1,22 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template class B {};
+};
+
+template struct X
+{
+};
+
+template struct C
+{
+ X x; // { dg-error "type" }
+};
+
+int main()
+{
+ C c;
+}
qualttp1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec1.C
===================================================================
--- spec1.C (nonexistent)
+++ spec1.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin:
+
+// Bug: ICE during invalid instantiation of member function
+// which enclosing class is specialized.
+
+template
+struct A
+{
+ void f(T) {}
+};
+
+template<>
+struct A
+{
+ void f(int) {}
+};
+
+template
+void A::f(int); // { dg-error "not match" }
spec1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend42.C
===================================================================
--- friend42.C (nonexistent)
+++ friend42.C (revision 338)
@@ -0,0 +1,8 @@
+// { dg-do compile }
+
+template void foo (int);
+
+template
+class Q {
+ friend void foo (int = 3); // { dg-error "default argument" }
+};
friend42.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify3.C
===================================================================
--- unify3.C (nonexistent)
+++ unify3.C (revision 338)
@@ -0,0 +1,11 @@
+// Test unifying SCOPE_REF.
+// Origin: Marc Duflot
+// { dg-do compile }
+
+template class A {};
+template class R {};
+
+template struct Trait { enum {m = n}; };
+
+template R::m> f(A);
+template <> R<1> f(A<1>) {return R<1>();}
unify3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend17.C
===================================================================
--- memfriend17.C (nonexistent)
+++ memfriend17.C (revision 338)
@@ -0,0 +1,46 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// PR c++/13495: Nested class as template friend.
+
+template
+class A{
+public:
+ class B
+ {
+ void func1(void);
+ void func2(void);
+ };
+};
+
+template
+class F1
+{
+ friend class A
::B; + enum { foo = 0 }; // { dg-error "private" } +}; + +template+class F2 +{ + template + friend class A ::B; + enum { foo = 0 }; +}; + +template +void A ::B::func1(void) +{ + (void)F1 ::foo; + (void)F2 ::foo; +} + +template +void A ::B::func2(void) +{ + (void)F1 ::foo; // { dg-error "context" } + (void)F2 ::foo; +} + +template class A ; // { dg-message "instantiated" }
memfriend17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend25.C
===================================================================
--- friend25.C (nonexistent)
+++ friend25.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: Jiangbin Zhao
+
+// PR c++/12369: ICE for specialization of member function template
+// as friend in ordinary class.
+
+struct A {
+ template T* make() { return new T(); }
+};
+
+struct B {
+ friend B* A::make< B >(); // (1)
+};
friend25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg9.C
===================================================================
--- defarg9.C (nonexistent)
+++ defarg9.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/28048
+
+template struct Boom;
+
+template::Internal::Value> // <--ICE
+ struct Foo
+ {
+ };
+
+template struct Boom
+{
+ struct Internal
+ {
+ static const bool Value = false;
+ };
+};
defarg9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-args1.C
===================================================================
--- dependent-args1.C (nonexistent)
+++ dependent-args1.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/27582
+// { dg-do compile }
+
+struct A
+{
+ template void foo();
+};
+
+template > struct B {};
+
+B b; // { dg-error "type/value mismatch|expected a constant|invalid type" }
dependent-args1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void1.C
===================================================================
--- void1.C (nonexistent)
+++ void1.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/27430
+// { dg-do compile }
+
+template struct A; // { dg-error "array of void" }
void1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete5.C
===================================================================
--- incomplete5.C (nonexistent)
+++ incomplete5.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/33501
+// { dg-do compile }
+
+class A; // { dg-error "forward declaration" }
+
+template struct X
+{
+ static int f (T);
+ static const T &make ();
+ static const bool value = sizeof (f (make ())) == sizeof (int); // { dg-error "invalid use of incomplete type|initializing argument" }
+};
+
+int
+main ()
+{
+ return X ::value;
+}
incomplete5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inherit3.C
===================================================================
--- inherit3.C (nonexistent)
+++ inherit3.C (revision 338)
@@ -0,0 +1,12 @@
+template
+struct set {
+ void insert (const T&);
+ template
+ void insert (X, X);
+};
+
+struct C : public set {
+ void f (const int i) {
+ insert (i);
+ }
+};
inherit3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum1.C
===================================================================
--- enum1.C (nonexistent)
+++ enum1.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/15554
+
+template struct T1 { enum { N = 3 }; };
+template struct T2 { enum { N = 3, N1 = T1::N }; };
+
enum1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array17.C
===================================================================
--- array17.C (nonexistent)
+++ array17.C (revision 338)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+template
+struct V {
+ T& operator[](int);
+};
+
+struct S {
+ S operator +(int);
+ template T value();
+};
+
+template
+void R (T v)
+{
+ v[(S() + 0).template value()][0] = 0;
+}
+
+int
+main ()
+{
+ R(V >());
+}
array17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent9.C
===================================================================
--- non-dependent9.C (nonexistent)
+++ non-dependent9.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// Two-phase name lookup for address of member:
+// Overloading function
+
+struct S
+{
+ int f();
+ int f(int);
+};
+
+template
+struct X
+{};
+
+template
+struct Foo
+{
+ X<&S::f> x;
+};
non-dependent9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem3.C
===================================================================
--- ptrmem3.C (nonexistent)
+++ ptrmem3.C (revision 338)
@@ -0,0 +1,22 @@
+// Origin: Theo Papadopoulo
+
+template
+struct I {
+};
+
+struct R {
+ R() { }
+};
+
+class H: public R {
+public:
+ H(): R() { }
+ double& f() { return a; }
+ double f() const { return 1.0; }
+ double a;
+};
+
+struct A {
+ typedef I F;
+ A() { }
+};
ptrmem3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access7.C
===================================================================
--- access7.C (nonexistent)
+++ access7.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// PR c++/3663
+// Enforce access of nested type.
+
+template
+class S {
+ class T {}; // { dg-error "private" }
+};
+
+template
+typename A::T* f (A) { // { dg-error "this context" }
+ return 0;
+}
+
+void g () {
+ f (S ()); // { dg-message "instantiated" }
+}
access7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using12.C
===================================================================
--- using12.C (nonexistent)
+++ using12.C (revision 338)
@@ -0,0 +1,7 @@
+struct A {
+};
+
+template
+struct S : public A {
+ using A::operator(); // { dg-error "no member" }
+};
using12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static20.C
===================================================================
--- static20.C (nonexistent)
+++ static20.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/24277
+
+template< int Bits > struct uint_t {
+ typedef unsigned short fast;
+};
+template < int Bits > struct mask_uint_t {
+ typedef typename uint_t< Bits >::fast fast;
+ static const fast sig_bits = 1;
+ static const fast sig_bits_fast = fast(sig_bits);
+};
+template < int Bits> int checksum ( ) {
+ return 1 & mask_uint_t::sig_bits_fast;
+}
+int i = checksum<1>();
static20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv5.C
===================================================================
--- conv5.C (nonexistent)
+++ conv5.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Dec 2002
+
+// PR 764. Failed to find friend in overload resolution
+
+template
+struct S
+{
+ friend bool operator== (const S&, const S&) {
+ return true;
+ }
+};
+
+int main ()
+{
+ // S s;
+
+ const S *p = 0;
+ *p == *p; // error
+}
conv5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae5.C
===================================================================
--- sfinae5.C (nonexistent)
+++ sfinae5.C (revision 338)
@@ -0,0 +1,47 @@
+// DR 339
+//
+// Test of the use of member functions with SFINAE
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+template
+ typename enable_if<(sizeof(create_a().foo(), 1) > 0),
+ yes_type>::type
+ check_has_member_foo(const volatile T&);
+
+no_type check_has_member_foo(...);
+
+template
+struct has_foo
+{
+ static const bool value =
+ (sizeof(check_has_member_foo(create_a())) == sizeof(yes_type));
+};
+
+struct X { };
+struct Y {
+ void foo();
+};
+struct Z {
+ void foo(int);
+};
+
+struct A {
+ int foo;
+};
+
+struct B {
+ static int foo();
+};
+
+int a1[has_foo::value? -1 : 1];
+int a2[has_foo::value? 1 : -1];
+int a3[has_foo::value? -1 : 1];
+int a4[has_foo::value? -1 : 1];
+int a5[has_foo::value? -1 : 1];
+int a6[has_foo::value? 1 : -1];
sfinae5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: addr1.C
===================================================================
--- addr1.C (nonexistent)
+++ addr1.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/15542
+
+template struct S_T {
+ const char** operator & ();
+};
+
+template void foo(T **) {}
+
+template void templateTest() {
+ S_T s_t;
+ foo(&s_t);
+}
addr1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtmpl1.C
===================================================================
--- memtmpl1.C (nonexistent)
+++ memtmpl1.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jul 2003
+
+// PR 11347. ICE in tsubst
+
+template struct T1 {
+ enum {N};
+};
+
+template struct T2 {
+ template ::N + 1> struct B {};
+ struct C {};
+};
+
+T2 t;
+
+T2::B s;
+
memtmpl1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error12.C
===================================================================
--- error12.C (nonexistent)
+++ error12.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/15044
+
+template class class a { num_t n; } // { dg-error "" }
+
error12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp20.C
===================================================================
--- qualttp20.C (nonexistent)
+++ qualttp20.C (revision 338)
@@ -0,0 +1,36 @@
+// { dg-do compile }
+// { dg-options "-pedantic -pedantic-errors" }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2001
+
+// PR 2645
+
+struct AS
+{
+ typedef void (myT) ();
+ struct L {};
+
+};
+
+
+template struct B1 : T
+{
+ typedef typename T::L __restrict__ r;// { dg-error "'__restrict__' qualifiers cannot" "" }
+ typedef typename T::myT __restrict__ p;
+
+ // The following are DR 295 dependent
+ typedef typename T::myT volatile *myvolatile;
+ typename T::myT volatile *a;
+ myvolatile b;
+};
+template struct B2 : T
+{
+ // The following are DR 295 dependent
+ typedef typename T::myT const *myconst;
+ typename T::myT const *a;
+ myconst b;
+};
+
+B1 b1; // { dg-message "instantiated" "" }
+B2 b2;
qualttp20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec20.C
===================================================================
--- spec20.C (nonexistent)
+++ spec20.C (revision 338)
@@ -0,0 +1,19 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Mar 2005
+
+// Origin: Giovanni Bajo
+// Bug 19203: Failure to implement DR 214
+
+template
+void foo(const A& a);
+
+template
+int foo(RET (&)(ARG1)); // this one
+
+
+float decl(int);
+
+int bar(void)
+{
+ return foo(decl);
+}
spec20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member7.C
===================================================================
--- member7.C (nonexistent)
+++ member7.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/29080
+
+struct Base {
+ template void method() { }
+};
+
+struct Left : public Base { };
+struct Right : public Base { };
+struct Join : public Left, public Right { };
+
+void function()
+{
+ Join join;
+ join.Left::method();
+}
member7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vla2.C
===================================================================
--- vla2.C (nonexistent)
+++ vla2.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/28879
+// { dg-do compile }
+// { dg-options "" }
+
+struct A
+{
+ static int i;
+ int j;
+};
+
+template void foo ()
+{
+ int x[A::i];
+//int y[A().j];
+}
+
+void bar ()
+{
+ foo<6> ();
+}
vla2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae10.C
===================================================================
--- sfinae10.C (nonexistent)
+++ sfinae10.C (revision 338)
@@ -0,0 +1,181 @@
+// DR 339
+//
+// Test of the use of various unary operators with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#define DEFINE_PREFIX_UNARY_TRAIT(Name,Op) \
+template \
+ typename enable_if<(sizeof(Op create_a(), 1) > 0), \
+ yes_type>::type \
+ JOIN(check_,Name)(int); \
+ \
+template \
+ no_type JOIN(check_,Name)(...); \
+ \
+template \
+struct Name \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,Name)(0)) == sizeof(yes_type)); \
+}
+
+#define DEFINE_POSTFIX_UNARY_TRAIT(Name,Op) \
+template \
+ typename enable_if<(sizeof(create_a() Op, 1) > 0), \
+ yes_type>::type \
+ JOIN(check_,Name)(int); \
+ \
+template \
+ no_type JOIN(check_,Name)(...); \
+ \
+template \
+struct Name \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,Name)(0)) == sizeof(yes_type)); \
+}
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct W {
+ W operator+();
+ W operator-();
+ int operator*();
+ W operator~();
+ bool operator!();
+ W& operator++();
+ W& operator--();
+ W& operator++(int);
+ W& operator--(int);
+};
+
+struct X { };
+X operator+(X);
+X operator-(X);
+int operator*(X);
+X operator~(X);
+bool operator!(X);
+X& operator++(X&);
+X& operator--(X&);
+X& operator++(X&, int);
+X& operator--(X&, int);
+
+struct Y { };
+
+struct Z {
+private:
+ Z operator+(); // { dg-error "is private" }
+ Z operator-(); // { dg-error "is private" }
+ int operator*(); // { dg-error "is private" }
+ Z operator~(); // { dg-error "is private" }
+ bool operator!(); // { dg-error "is private" }
+ Z& operator++(); // { dg-error "is private" }
+ Z& operator--(); // { dg-error "is private" }
+ Z& operator++(int); // { dg-error "is private" }
+ Z& operator--(int); // { dg-error "is private" }
+};
+
+// has_unary_plus
+DEFINE_PREFIX_UNARY_TRAIT(has_unary_plus, +); // { dg-error "within this context" }
+STATIC_ASSERT((has_unary_plus::value));
+STATIC_ASSERT((!has_unary_plus::value));
+STATIC_ASSERT((has_unary_plus::value));
+STATIC_ASSERT((has_unary_plus::value));
+STATIC_ASSERT((!has_unary_plus::value));
+
+// is_negatable
+DEFINE_PREFIX_UNARY_TRAIT(is_negatable, -); // { dg-error "within this context" }
+STATIC_ASSERT((is_negatable::value));
+STATIC_ASSERT((!is_negatable::value));
+STATIC_ASSERT((is_negatable::value));
+STATIC_ASSERT((is_negatable::value));
+STATIC_ASSERT((!is_negatable::value));
+
+// is_dereferenceable
+DEFINE_PREFIX_UNARY_TRAIT(is_dereferenceable, *); // { dg-error "within this context" }
+STATIC_ASSERT((!is_dereferenceable::value));
+STATIC_ASSERT((is_dereferenceable::value));
+STATIC_ASSERT((is_dereferenceable::value));
+STATIC_ASSERT((is_dereferenceable::value));
+STATIC_ASSERT((!is_dereferenceable::value));
+
+// has_bitwise_not
+DEFINE_PREFIX_UNARY_TRAIT(has_bitwise_not, ~); // { dg-error "within this context" }
+STATIC_ASSERT((has_bitwise_not::value));
+STATIC_ASSERT((!has_bitwise_not::value));
+STATIC_ASSERT((has_bitwise_not::value));
+STATIC_ASSERT((has_bitwise_not::value));
+STATIC_ASSERT((!has_bitwise_not::value));
+
+// has_truth_not
+DEFINE_PREFIX_UNARY_TRAIT(has_truth_not, !); // { dg-error "within this context" }
+STATIC_ASSERT((has_truth_not::value));
+STATIC_ASSERT((has_truth_not::value));
+STATIC_ASSERT((has_truth_not::value));
+STATIC_ASSERT((has_truth_not::value));
+STATIC_ASSERT((!has_truth_not::value));
+
+// has_preincrement
+DEFINE_PREFIX_UNARY_TRAIT(has_preincrement, ++); // { dg-error "within this context" }
+STATIC_ASSERT((has_preincrement::value));
+STATIC_ASSERT((has_preincrement::value));
+STATIC_ASSERT((!has_preincrement::value));
+STATIC_ASSERT((has_preincrement::value));
+STATIC_ASSERT((has_preincrement::value));
+STATIC_ASSERT((!has_preincrement::value));
+
+// has_predecrement
+DEFINE_PREFIX_UNARY_TRAIT(has_predecrement, --); // { dg-error "within this context" }
+STATIC_ASSERT((has_predecrement::value));
+STATIC_ASSERT((has_predecrement::value));
+STATIC_ASSERT((!has_predecrement::value));
+STATIC_ASSERT((has_predecrement::value));
+STATIC_ASSERT((has_predecrement::value));
+STATIC_ASSERT((!has_predecrement::value));
+
+// has_postincrement
+DEFINE_POSTFIX_UNARY_TRAIT(has_postincrement, ++); // { dg-error "within this context" }
+STATIC_ASSERT((has_postincrement::value));
+STATIC_ASSERT((has_postincrement::value));
+STATIC_ASSERT((!has_postincrement::value));
+STATIC_ASSERT((has_postincrement::value));
+STATIC_ASSERT((has_postincrement::value));
+STATIC_ASSERT((!has_postincrement::value));
+
+// has_postdecrement
+DEFINE_POSTFIX_UNARY_TRAIT(has_postdecrement, --); // { dg-error "within this context" }
+STATIC_ASSERT((has_postdecrement::value));
+STATIC_ASSERT((has_postdecrement::value));
+STATIC_ASSERT((!has_postdecrement::value));
+STATIC_ASSERT((has_postdecrement::value));
+STATIC_ASSERT((has_postdecrement::value));
+STATIC_ASSERT((!has_postdecrement::value));
+
+// Check for private members
+STATIC_ASSERT((has_unary_plus::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((is_negatable::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((is_dereferenceable::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_bitwise_not::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_truth_not::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_preincrement::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_predecrement::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_postincrement::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_postdecrement::value)); // { dg-message "instantiated from here" }
+
sfinae10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash60.C
===================================================================
--- crash60.C (nonexistent)
+++ crash60.C (revision 338)
@@ -0,0 +1,9 @@
+//PR c++/27961
+
+struct A
+{
+ template void foo(X); // { dg-error "declared" }
+};
+
+template void f()(0); // { dg-error "initialize" }
+
crash60.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access14.C
===================================================================
--- access14.C (nonexistent)
+++ access14.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/14777
+
+template
+struct B
+{
+protected:
+ typedef int M;
+};
+
+template
+struct A : B {
+ typedef typename B::M N;
+ A (int = N ());
+};
+
+A a = A ();
access14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv10.C
===================================================================
--- conv10.C (nonexistent)
+++ conv10.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/41994
+
+template struct A
+{
+ operator T();
+ A() { T (A::*f)() = &A::operator T; }
+};
+
+A a;
conv10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash43.C
===================================================================
--- crash43.C (nonexistent)
+++ crash43.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/24687
+
+extern "C" {
+ template // { dg-error "C" }
+ struct ___is_pod {
+ enum {
+ __value = (sizeof(__gnu_internal::__test_type<_Tp>(0)))}; // { dg-error "declared|expected" }
+
crash43.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename6.C
===================================================================
--- typename6.C (nonexistent)
+++ typename6.C (revision 338)
@@ -0,0 +1,11 @@
+struct O {
+ template
+ struct I {
+ I (int);
+ };
+};
+
+template
+void f() {
+ typename ::O::I(3);
+}
typename6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef17.C
===================================================================
--- typedef17.C (nonexistent)
+++ typedef17.C (revision 338)
@@ -0,0 +1,32 @@
+// PR c++/37806
+
+extern "C" int printf (const char *, ...);
+
+template
+struct S1
+{
+ typedef void (function_type)(int) const;
+};
+
+
+struct S2: public S1
+{
+ virtual function_type f = 0;
+};
+
+struct S3: public S2
+{
+ void
+ f (int i) const
+ {
+ printf ("Hello world: %d\n", i);
+ }
+};
+
+
+int
+main()
+{
+ S3 s;
+ s.f(5);
+}
typedef17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: recurse.C
===================================================================
--- recurse.C (nonexistent)
+++ recurse.C (revision 338)
@@ -0,0 +1,28 @@
+// Test for handling of excessive template recursion.
+// { dg-options "-ftemplate-depth-50 -O" }
+
+template struct F
+{
+ int operator()()
+ {
+ F f; // { dg-error "incomplete type" "incomplete" }
+ // { dg-bogus "exceeds maximum.*exceeds maximum" "exceeds" { xfail *-*-* } 8 }
+ // { dg-error "exceeds maximum" "exceeds" { xfail *-*-* } 8 }
+ return f()*I; // { dg-message "instantiated" "recurse" }
+ // { dg-message "skipping 40 instantiation contexts" "" { target *-*-* } 11 }
+ }
+};
+
+template <> struct F<52>
+{
+ int operator()() { return 0; }
+};
+
+int main ()
+{
+ F<1> f;
+ return f(); // { dg-message "instantiated from here" "excessive recursion" }
+}
+
+// Ignore excess messages from recursion.
+// { dg-prune-output "instantiated from 'int" }
recurse.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash26.C
===================================================================
--- crash26.C (nonexistent)
+++ crash26.C (revision 338)
@@ -0,0 +1,8 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt
+
+// PR c++/18471: ICE redeclaration of typedef as class template
+
+typedef int X; // { dg-error "previous" }
+template struct X {}; // { dg-error "typedef-name" }
crash26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: union2.C
===================================================================
--- union2.C (nonexistent)
+++ union2.C (revision 338)
@@ -0,0 +1,12 @@
+/* PR c++/40557 */
+/* { dg-do "compile" } */
+
+struct A
+{
+ typedef int X;
+};
+
+template union B
+{
+ A::X x;
+};
union2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new3.C
===================================================================
--- new3.C (nonexistent)
+++ new3.C (revision 338)
@@ -0,0 +1,17 @@
+extern void *operator new(__SIZE_TYPE__); // { dg-message "candidate" }
+
+template
+struct C
+{
+ void f() {
+ int* node;
+ new (&node) int(0); // { dg-error "new" }
+ }
+};
+
+void* operator new(__SIZE_TYPE__, void* __p);
+
+void g() {
+ C c;
+ c.f();
+}
new3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend34.C
===================================================================
--- friend34.C (nonexistent)
+++ friend34.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: mleone@pixar.com
+// Wolfgang Bangerth
+
+// PR c++/9783: Forward declaration of class in template.
+
+template
+struct C {
+ void foo (struct X *);
+};
+
+struct X {};
+
+template
+void C::foo(struct X *) {}
friend34.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend17.C
===================================================================
--- friend17.C (nonexistent)
+++ friend17.C (revision 338)
@@ -0,0 +1,12 @@
+template
+struct X {
+ template void operator+=(U);
+
+ template
+ template
+ friend void X::operator+=(U);
+};
+
+int main() {
+ X() += 1.0;
+}
friend17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator6.C
===================================================================
--- operator6.C (nonexistent)
+++ operator6.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/27315
+// { dg-do compile }
+
+template void operator+; // { dg-error "non-function" }
operator6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: redecl4.C
===================================================================
--- redecl4.C (nonexistent)
+++ redecl4.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/28710
+// { dg-do compile }
+
+template union A; // { dg-error "previous" }
+struct A; // { dg-error "non-template" }
redecl4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: meminit2.C
===================================================================
--- meminit2.C (nonexistent)
+++ meminit2.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// Origin: Mark Anders
+// PR c++/15503: disambiguators in base classes and mem-initializers
+
+template struct O {
+ template struct I {};
+};
+
+template
+struct A : typename O::template I { // { dg-error "keyword 'typename' not allowed" }
+ A() : typename O::template I() // { dg-error "keyword 'typename' not allowed" }
+ {}
+};
+
+template
+struct B : O::template I {
+ B() : O::I() // { dg-error "used as template|it is a template" "" }
+ {}
+};
+
+// { dg-bogus "end of input" "bogus token skipping in the parser" { xfail *-*-* } 17 }
meminit2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init3.C
===================================================================
--- init3.C (nonexistent)
+++ init3.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/11027
+
+template
+struct X {
+ typedef void (X::*pfun)();
+ static pfun p[];
+};
+
+template
+typename X::pfun X::p[] = {};
+
init3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: decl1.C
===================================================================
--- decl1.C (nonexistent)
+++ decl1.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/3882
+// Verify that variable initialization can be
+// self-referencing inside a template function.
+
+int foo(int);
+
+template
+void bar(const T&)
+{
+ int i = foo(i);
+}
+
+void quus()
+{
+ bar(0);
+}
decl1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static12.C
===================================================================
--- static12.C (nonexistent)
+++ static12.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/18470
+
+template struct A
+{
+ static const int i=1;
+};
+
+template struct B : A
+{
+ using A::i;
+ char s[i]; // fails
+ char t[A::i]; // compiles
+};
static12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg2.C
===================================================================
--- arg2.C (nonexistent)
+++ arg2.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2003
+
+// PR 9708. We accepted a local class
+
+template class X {};
+
+void fn ()
+{
+ class L {};
+ X f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" }
+}
arg2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pure1.C
===================================================================
--- pure1.C (nonexistent)
+++ pure1.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/26122
+
+struct A
+{
+ template void foo() = 1; // { dg-error "pure|non-virtual" }
+};
pure1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error21.C
===================================================================
--- error21.C (nonexistent)
+++ error21.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/20173
+
+template
+struct A{
+ template
+ void function(T){}
+};
+
+template<>
+template
+void A::function(T){}
+
+template<>
+template
+void A::function(T*){} // { dg-error "match" }
error21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec12.C
===================================================================
--- spec12.C (nonexistent)
+++ spec12.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Contributed by: Wolfgang Bangerth
+// PR c++/14409: Accepts invalid function signature for explicit instantiation
+
+struct X
+{
+ template
+ void foo (U) {}
+
+ template
+ void foo_const (U) const {}
+};
+
+template void X::foo (int);
+template void X::foo_const (int) const;
+
+template void X::foo (int) const; // { dg-error "" }
+template void X::foo_const (int); // { dg-error "" }
spec12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo8.C
===================================================================
--- repo8.C (nonexistent)
+++ repo8.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/34340
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+struct A
+{
+ int a;
+};
+
+template struct D
+{
+ static const A b;
+};
+
+template const A D::b = { 2 };
+
+const A *x = &D::b;
+
+int
+main ()
+{
+}
repo8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp12.C
===================================================================
--- qualttp12.C (nonexistent)
+++ qualttp12.C (revision 338)
@@ -0,0 +1,24 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do link }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> void f()
+{
+ TT y;
+}
+
+template struct C
+{
+ void g() { f(); }
+};
+
+int main()
+{
+ C c;
+ c.g();
+}
qualttp12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ref3.C
===================================================================
--- ref3.C (nonexistent)
+++ ref3.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/28341
+
+template struct A {};
+
+template struct B
+{
+ A<(T)0> b; // { dg-error "constant" }
+ A a; // { dg-error "constant" }
+};
+
+B b;
ref3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload8.C
===================================================================
--- overload8.C (nonexistent)
+++ overload8.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/24915
+
+struct A
+{
+ template void foo() {}
+ template int foo() {}
+};
overload8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: stmtexpr1.C
===================================================================
--- stmtexpr1.C (nonexistent)
+++ stmtexpr1.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/17404
+// { dg-do compile }
+// { dg-options "" }
+
+template void foo ()
+{
+ __builtin_expect (({0;}), 1);
+}
+
+template void foo<1> ();
stmtexpr1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash52.C
===================================================================
--- crash52.C (nonexistent)
+++ crash52.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/27665
+
+template struct A
+{
+ struct B
+ {
+ struct C {};
+ };
+};
+
+template void foo()
+{
+ class A::B::C X;
+}
+
+void bar()
+{
+ foo<0>();
+}
crash52.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: const1.C
===================================================================
--- const1.C (nonexistent)
+++ const1.C (revision 338)
@@ -0,0 +1,30 @@
+// PR c++/28385
+// instantiating op() with void()() was making the compiler think that 'fcn'
+// was const, so it could eliminate the call.
+
+// { dg-do run }
+
+extern "C" void abort (void);
+
+int barcnt = 0;
+
+class Foo {
+ public:
+ template
+ void operator()(const T& fcn) {
+ fcn();
+ }
+};
+
+void bar() {
+ barcnt++;
+}
+
+int main() {
+ Foo myFoo;
+ myFoo(bar);
+ myFoo(&bar);
+ if (barcnt != 2)
+ abort ();
+ return 0;
+}
const1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef26.C
===================================================================
--- typedef26.C (nonexistent)
+++ typedef26.C (revision 338)
@@ -0,0 +1,40 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/42225
+// { dg-do compile }
+
+struct A
+{
+ typedef int TI;
+};
+
+template
+struct S0
+{
+ int i;
+};
+
+template
+struct S1
+{
+ typedef _T T;
+ typedef typename T::TI TTI;
+ typedef S0 TT0;
+ typedef S0 TT1;
+};
+
+template
+void
+foo(const T&)
+{
+ typedef typename T::TI TTI;
+ typedef S0 TT1;
+ typedef S0 TT2;
+}
+
+int
+main()
+{
+ A a;
+ foo (a);
+}
+
typedef26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr6.C
===================================================================
--- dependent-expr6.C (nonexistent)
+++ dependent-expr6.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Copyright 2007 Free Software Foundation
+// Contributed by Andreas Krebbel
+
+// PR C++ 34081 ICE
+
+class Foo;
+
+template < class Foo > class Bar
+{
+ enum Status
+ { OK, NO };
+
+ enum Status getStatus ()
+ {
+ return status;
+ }
+
+ Status status;
+};
dependent-expr6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash35.C
===================================================================
--- crash35.C (nonexistent)
+++ crash35.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/20463
+// { dg-do compile }
+
+template struct C; // { dg-error "declaration" }
+
+template void C::f() // { dg-error "invalid|template" }
+{
+ const foo bar;
+}
crash35.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash18.C
===================================================================
--- crash18.C (nonexistent)
+++ crash18.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// Contributed by:
+// PR c++/15064: typeid does not form an integral constant expression
+
+#include
+
+template
+void dummy() {
+ const std::type_info& t = typeid(T);
+ const std::type_info& t2 = typeid(float);
+}
+
+template void dummy(void);
crash18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error2.C
===================================================================
--- error2.C (nonexistent)
+++ error2.C (revision 338)
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2003
+
+// instantiated from did not indicate the nested class
+
+template struct X
+{
+ T m; // { dg-error "as type 'void'" "void" }
+ // { dg-error "incomplete type" "incomplate" { target *-*-* } 10 }
+ // { dg-error "invalid" "invalid" { target *-*-* } 10 }
+};
+
+template
+struct Derived
+{
+ class Nested : public X
+ { // { dg-message "instantiated" "" }
+ };
+
+ Nested m; // { dg-message "instantiated" "" }
+
+ void Foo ();
+};
+
+void Foo (Derived &x)
+{
+ x.Foo (); // { dg-message "instantiated" "" }
+}
error2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec2.C
===================================================================
--- spec2.C (nonexistent)
+++ spec2.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin:
+
+// Bug: Overloading of ordinary and template member function
+// which enclosing class is specialized is not handled correctly.
+
+template
+struct A
+{
+ void f(T) {}
+};
+
+template<>
+struct A
+{
+ void f(int) {}
+ template void f(T) {}
+};
+
+template
+void A::f(int);
spec2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp2.C
===================================================================
--- qualttp2.C (nonexistent)
+++ qualttp2.C (revision 338)
@@ -0,0 +1,22 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template class B {};
+};
+
+template struct X
+{
+};
+
+template struct C
+{
+ X x; // { dg-error "type" }
+};
+
+int main()
+{
+ C c;
+}
qualttp2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload10.C
===================================================================
--- overload10.C (nonexistent)
+++ overload10.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++40342
+
+template int f(T1 *, const T2 *); // { dg-error "" }
+template int f(const T1 *, T2 *); // { dg-error "" }
+
+int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" }
overload10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify4.C
===================================================================
--- unify4.C (nonexistent)
+++ unify4.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Jan 2003
+
+// PR 9437. We'd unify 'T *' with 'U C::*', which is obviously broken
+
+struct X
+{
+ template
+ operator T* () const { return static_cast (0); }
+} null;
+
+struct A { int i; };
+
+static void f (int A::* pmi) { }
+
+int main () { f (null); } // { dg-error "cannot convert" "" }
unify4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend43.C
===================================================================
--- friend43.C (nonexistent)
+++ friend43.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/28111
+// { dg-do compile }
+
+template void foo();
+
+template struct A
+{
+ friend void foo<>(typename T::X); // { dg-error "not a class" }
+};
+
+A a;
friend43.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend26.C
===================================================================
--- friend26.C (nonexistent)
+++ friend26.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/14359
+
+template struct A {};
+
+template struct B
+{
+ template friend void foo(const A& a, const B&) { a; }
+};
+
+void bar()
+{
+ A a;
+ B b;
+ foo(a,b);
+}
friend26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof1.C
===================================================================
--- sizeof1.C (nonexistent)
+++ sizeof1.C (revision 338)
@@ -0,0 +1,15 @@
+// Test use of `sizeof' as a template parameter.
+// Origin: smacdonald@seimac.com
+
+// { dg-do compile }
+
+template struct A { static char *value; };
+
+template
+struct B
+{
+char * f() const
+{
+return (A::value);
+}
+};
sizeof1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void2.C
===================================================================
--- void2.C (nonexistent)
+++ void2.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/27496
+// { dg-do compile }
+
+template struct A
+{
+ template friend class X; // { dg-error "void|valid type" }
+};
+
+A<0> a;
void2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr32519.C
===================================================================
--- pr32519.C (nonexistent)
+++ pr32519.C (revision 338)
@@ -0,0 +1,16 @@
+// PR 32519
+// { dg-do compile }
+
+struct B
+{
+protected:
+ template void f (); // { dg-error "protected" }
+};
+
+struct D : public B
+{
+ void g (B* b)
+ {
+ b->f (); // { dg-error "context" }
+ }
+};
pr32519.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum2.C
===================================================================
--- enum2.C (nonexistent)
+++ enum2.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/15877
+
+template struct T1 { enum { N = 3 }; };
+template struct T2 { enum { N = n, N1 = T1::N }; };
enum2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inherit4.C
===================================================================
--- inherit4.C (nonexistent)
+++ inherit4.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/21008, DR 515
+
+struct A {
+ int foo_;
+};
+template struct B: public A { };
+template struct C: B {
+ int foo() {
+ return A::foo_; // #1
+ }
+};
+int f(C* p) {
+ return p->foo();
+}
inherit4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array18.C
===================================================================
--- array18.C (nonexistent)
+++ array18.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/30924
+
+template
+struct x {};
+
+template
+struct x {};
+
+int main() {
+ x a;
+ x b;
+ return 0;
+}
array18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: warn1.C
===================================================================
--- warn1.C (nonexistent)
+++ warn1.C (revision 338)
@@ -0,0 +1,36 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2003
+
+// PR 11512. erroneous warnings
+
+template void Foo(T i)
+{
+ i++, i++;
+ i, i++; // { dg-warning "left-hand operand" "" }
+ i++, i; // { dg-warning "right-hand operand" "" }
+ for (;; --i, ++i)
+ ;
+}
+
+void Bar ()
+{
+ Foo (1); // { dg-message "instantiated" }
+}
+
+struct M {};
+
+struct C
+{
+ M m;
+ C () :m (M ()) {}
+};
+
+
+void Baz (int i)
+{
+ i ? i + 1 : i + 2; // { dg-warning "operand of" }
+ i ? i++ : 0;
+}
warn1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp1.C
===================================================================
--- ttp1.C (nonexistent)
+++ ttp1.C (revision 338)
@@ -0,0 +1,9 @@
+// Origin: Volker Reichelt
+// { dg-do compile }
+
+template class A >
+class B : virtual A
+{
+ typedef int INT;
+ INT i;
+};
ttp1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem4.C
===================================================================
--- ptrmem4.C (nonexistent)
+++ ptrmem4.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: Scott Snyder
+
+// PR c++/8849
+// Pointer to member function template argument deduction ICE.
+
+
+template void queryAliases(CONT& fill_me); // { dg-message "candidate is" }
+
+struct SpyExample
+{
+ void ready();
+ void inputs();
+};
+
+void SpyExample::ready()
+{
+ queryAliases(inputs); // { dg-error "matching" }
+}
ptrmem4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using13.C
===================================================================
--- using13.C (nonexistent)
+++ using13.C (revision 338)
@@ -0,0 +1,11 @@
+//PR c++/28051
+
+template struct A {};
+
+template struct B : A
+{
+ using A::operator typename A::X; // { dg-error "no type named" }
+};
+
+B<0> b;
+
using13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access8.C
===================================================================
--- access8.C (nonexistent)
+++ access8.C (revision 338)
@@ -0,0 +1,16 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+// Template instantiate during deferred access check
+
+template struct C {
+ typedef typename T::X Y;
+};
+
+class A {
+ typedef int X;
+ template friend struct C;
+};
+
+C::Y f(int);
access8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static21.C
===================================================================
--- static21.C (nonexistent)
+++ static21.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/24389
+// { dg-additional-sources "static21-a.cc" }
+// { dg-do link }
+
+template
+struct X
+{
+ static const int n_primes = 256;
+ static const unsigned long primes[n_primes + 1];
+};
+
+template
+const int X::n_primes;
+
+template
+const unsigned long X::primes[n_primes + 1] =
+ { 0 };
+
+const unsigned long *f(void){return &X<0>::primes[0];}
+
static21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae6.C
===================================================================
--- sfinae6.C (nonexistent)
+++ sfinae6.C (revision 338)
@@ -0,0 +1,83 @@
+// DR 339
+//
+// Test of the use of the function call operator with SFINAE
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+template
+ typename enable_if()(create_a(), create_a()), 1),
+ yes_type>::type
+ check_is_callable2(type, type, type);
+
+no_type check_is_callable2(...);
+
+template
+struct is_callable2
+{
+ static const bool value =
+ (sizeof(check_is_callable2(type(), type(), type()))
+ == sizeof(yes_type));
+};
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+
+struct A;
+struct B;
+
+struct A {
+ A(B);
+};
+
+struct B {
+ B(A);
+};
+
+struct F1 { };
+
+struct F2 {
+ bool operator()(int, float);
+};
+
+struct F3 {
+ bool operator()(int);
+};
+
+struct F4 {
+ void operator()(A, A);
+ void operator()(B, B);
+};
+
+struct F5 {
+ void operator()(A, A);
+
+private:
+ void operator()(B, B);
+};
+
+STATIC_ASSERT((is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
+STATIC_ASSERT((is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
+STATIC_ASSERT((is_callable2::value));
+STATIC_ASSERT((is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
+STATIC_ASSERT((is_callable2::value));
+STATIC_ASSERT((!is_callable2::value));
sfinae6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv6.C
===================================================================
--- conv6.C (nonexistent)
+++ conv6.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2003
+
+// PR 9898, DR 322. Conversion to reference type.
+
+template struct Ref {};
+template struct Val {};
+
+struct Wrapper
+{
+ template operator Ref & ();
+ template operator Val ();
+};
+
+void Foo (Wrapper l)
+{
+ static_cast &> (l);
+ static_cast const &> (l);
+ static_cast > (l);
+ static_cast const &> (l);
+ static_cast > (l);
+}
conv6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error30.C
===================================================================
--- error30.C (nonexistent)
+++ error30.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/33210
+
+template struct A;
+
+template class B> A::x> operator() (); // { dg-error "A::x>" }
error30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec21.C
===================================================================
--- spec21.C (nonexistent)
+++ spec21.C (revision 338)
@@ -0,0 +1,28 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Mar 2005
+
+// { dg-do run }
+// DR214
+
+template T f(int) {return 0;}
+template T f(U){return 1;}
+
+template T checked_cast (R const &) {return 0;}
+template T checked_cast (R *) {return 1;}
+
+
+int main ()
+{
+ int i = 0;
+
+ if (f(1))
+ return 1;
+
+ if (checked_cast(i) != 0)
+ return 2;
+
+ if (checked_cast(&i) != 1)
+ return 3;
+
+ return 0;
+}
spec21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp21.C
===================================================================
--- qualttp21.C (nonexistent)
+++ qualttp21.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2002 Free Software Foundation
+// Contributed by Roger Sayle
+// { dg-do compile }
+
+template
+class foo {
+ int _foo;
+public:
+ foo() {}
+protected:
+ ~foo() {} // { dg-error "~foo" }
+};
+
+int main()
+{
+ foo a; // { dg-error "context" }
+}
qualttp21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error13.C
===================================================================
--- error13.C (nonexistent)
+++ error13.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/15227
+
+template struct A {};
+
+template void A::B::foo() {} // { dg-error "" }
error13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtmpl2.C
===================================================================
--- memtmpl2.C (nonexistent)
+++ memtmpl2.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Sep 2003
+
+// PR c++/12332. ICE
+
+template class TPL;
+
+template struct X {
+ template class V>
+ V::d> > operator () ();
+};
+
+void Foo (X x) {}
memtmpl2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member8.C
===================================================================
--- member8.C (nonexistent)
+++ member8.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/35138
+// { dg-do compile }
+
+namespace N1 { struct A { }; }
+namespace N2 { struct A { }; }
+using namespace N1;
+using namespace N2;
+
+template int
+foo (T const &t)
+{
+ return t.A;
+}
+
+struct B
+{
+ int A;
+};
+
+int
+main ()
+{
+ B b;
+ foo (b);
+}
member8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash61.C
===================================================================
--- crash61.C (nonexistent)
+++ crash61.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/29733
+
+template void foo()
+{
+ T t = 0; // { dg-error "function type" }
+}
+
+void bar()
+{
+ foo();
+}
crash61.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access15.C
===================================================================
--- access15.C (nonexistent)
+++ access15.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Aug 2004
+// Origin: stefaandr@hotmail.com
+
+// Bug 17149: ICE with TEMPLATE_TYPE_PARM
+
+
+template
+struct x {};
access15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae11.C
===================================================================
--- sfinae11.C (nonexistent)
+++ sfinae11.C (revision 338)
@@ -0,0 +1,53 @@
+// DR 339
+//
+// Test of the use of the comma operator with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+template
+ typename enable_if<(sizeof(create_a(), create_a()) > 0),
+ yes_type>::type
+ check_comma(int);
+
+template no_type check_comma(...);
+
+template
+struct has_comma
+{
+ static const bool value =
+ (sizeof(check_comma(0)) == sizeof(yes_type));
+};
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct X { };
+struct Y { };
+struct Z { };
+
+bool operator,(X&, Y);
+bool operator,(X, Z);
+void operator,(const Y&, const Z&);
+
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((has_comma::value));
+STATIC_ASSERT((!has_comma::value));
sfinae11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash44.C
===================================================================
--- crash44.C (nonexistent)
+++ crash44.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/25858
+
+namespace N {
+ template struct A {};
+}
+
+struct B N::A<0> {}; // { dg-error "invalid" }
crash44.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static1.C
===================================================================
--- static1.C (nonexistent)
+++ static1.C (revision 338)
@@ -0,0 +1,4 @@
+template struct A
+{
+ static const int t[1][1]={{0}}; // { dg-error "brace-enclosed|in-class" }
+};
static1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash27.C
===================================================================
--- crash27.C (nonexistent)
+++ crash27.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/18586
+template struct A {
+ template int A::i; // { dg-error "" }
+};
crash27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef18.C
===================================================================
--- typedef18.C (nonexistent)
+++ typedef18.C (revision 338)
@@ -0,0 +1,24 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/40007
+// { dg-do compile }
+
+template
+struct x
+{
+ protected:
+ typedef int type;
+};
+
+template
+struct y : public x
+{
+ typename x::type z;
+};
+
+template<>
+struct y : public x
+{
+ typedef x::type z;
+};
+
+template class y;
typedef18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename7.C
===================================================================
--- typename7.C (nonexistent)
+++ typename7.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/17501
+
+template struct A;
+
+template<> struct A<0>
+{
+ struct B
+ {
+ struct C
+ {
+ typedef int D;
+ };
+ };
+};
+
+template struct E
+{
+ typename A::B::C::D i;
+};
typename7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new4.C
===================================================================
--- new4.C (nonexistent)
+++ new4.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/27559
+// { dg-do compile }
+
+struct A
+{
+ template
+ static void* operator new(T) {} // { dg-error "first parameter|invalid template" }
+};
new4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend35.C
===================================================================
--- friend35.C (nonexistent)
+++ friend35.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// PR c++/4403: Incorrect friend class chosen during instantiation.
+
+template
+struct A
+{
+ struct F;
+};
+
+template
+struct B : A
+{
+ friend struct F;
+private:
+ int priv;
+};
+
+struct F
+{
+ void func(void)
+ {
+ B b;
+ b.priv = 0;
+ }
+};
friend35.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend18.C
===================================================================
--- friend18.C (nonexistent)
+++ friend18.C (revision 338)
@@ -0,0 +1,19 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Mar 2003
+
+// PR 10158. implicit inline template friends ICE'd
+
+template struct X
+{
+ template friend int foo(X const &)
+ {
+ return N * 10000 + M;
+ }
+};
+X<1234> bring;
+
+int main() {
+ return foo<5678> (bring) != 12345678;
+}
friend18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator7.C
===================================================================
--- operator7.C (nonexistent)
+++ operator7.C (revision 338)
@@ -0,0 +1,7 @@
+//PR c++/27493
+// { dg-options "-std=gnu++98" }
+
+template void foo() // { dg-error "before|template" }
+{
+ struct A {};
+}
operator7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init4.C
===================================================================
--- init4.C (nonexistent)
+++ init4.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2004
+
+// PR 18905. bogus error
+// Origin: Andrew Pinski
+
+int f1(char);
+template
+void f(void)
+{
+ const char* const suffixes = "plpv";
+ f1(suffixes[t]);
+}
init4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: decl2.C
===================================================================
--- decl2.C (nonexistent)
+++ decl2.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/16162
+
+template struct O {
+ struct I {
+ template struct II {
+ void f();
+ };
+ };
+};
+
+template
+template
+void O::I::II::f () {}
decl2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static30.C
===================================================================
--- static30.C (nonexistent)
+++ static30.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/31992
+
+template struct A
+{
+ static const int i1;
+ static const int i2;
+};
+
+template const int A::i1(A::i);
+template const int A::i2(3, A::i);
static30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static13.C
===================================================================
--- static13.C (nonexistent)
+++ static13.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/23099
+
+struct Base {
+ int x;
+};
+
+template
+struct A {
+ static const int N = sizeof(static_cast (T()));
+};
+
+struct Derived : Base {
+ A a;
+};
static13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg3.C
===================================================================
--- arg3.C (nonexistent)
+++ arg3.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Mar 2003
+
+// PR 10224. Rejected a valid constant argument.
+
+template struct X {
+ struct I {};
+};
+
+template struct Y {
+ static const bool selector = true;
+ typedef typename X::I helper;
+};
+
+Y i;
arg3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error22.C
===================================================================
--- error22.C (nonexistent)
+++ error22.C (revision 338)
@@ -0,0 +1,9 @@
+//PR c++/27821
+
+struct A
+{
+ template struct B {};
+ void ::foo(); // { dg-error "invalid use" }
+ B<&A::foo> b; // { dg-error "incomplete type|template argument" }
+};
+
error22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec30.C
===================================================================
--- spec30.C (nonexistent)
+++ spec30.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+template
+inline int
+foo (int a)
+{
+ return a;
+}
+
+template<>
+inline int
+foo<0> (int a = 123) // { dg-error "default argument" }
+{
+ return a + 1;
+}
spec30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp13.C
===================================================================
--- qualttp13.C (nonexistent)
+++ qualttp13.C (revision 338)
@@ -0,0 +1,27 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+template struct A
+{
+ template struct AA {
+ template struct B {
+ int i;
+ B() : i(1) {}
+ };
+ };
+};
+
+template class TT> struct X
+{
+ TT y;
+};
+
+template struct C
+{
+ X::template B> x;
+};
+
+int main()
+{
+ C, int> c;
+}
qualttp13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo9.C
===================================================================
--- repo9.C (nonexistent)
+++ repo9.C (revision 338)
@@ -0,0 +1,49 @@
+// PR c++/36364
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+template struct A
+{
+ static void assign (C &c1, const C &c2) { c1 = c2; }
+};
+
+template struct B
+{
+ struct D
+ {
+ static const C terminal;
+ static unsigned long stor[];
+ static D &empty_rep ()
+ {
+ void *p = reinterpret_cast (&stor);
+ return *reinterpret_cast (p);
+ }
+ void test (unsigned long n)
+ {
+ T::assign (this->refdata ()[n], terminal);
+ }
+ C *refdata () throw ()
+ {
+ return reinterpret_cast (this + 1);
+ }
+ };
+ C *dataplus;
+ C *data () const { return dataplus; }
+ D *rep () const { return &((reinterpret_cast < D * >(data ()))[-1]); }
+ static D & empty_rep () { return D::empty_rep (); }
+ B () : dataplus (empty_rep ().refdata ()) { }
+ ~B () { }
+ void push_back (C c) { rep ()->test (10); }
+};
+
+template const C B ::D::terminal = C ();
+template unsigned long B ::D::stor[64];
+
+int
+main ()
+{
+ B > s;
+ s.push_back ('a');
+}
repo9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec13.C
===================================================================
--- spec13.C (nonexistent)
+++ spec13.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-options "-w" }
+
+template
+struct S {
+ int i;
+ template void f(U) {}
+};
+
+template<>
+template
+void S::f(U) { i; }
+
+void f() {
+ S s;
+ s.f(3);
+}
spec13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ref4.C
===================================================================
--- ref4.C (nonexistent)
+++ ref4.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/41972
+
+struct X {
+ static const double x;
+};
+template
+ class Foo { };
+template
+struct Y {
+ typedef Foo type;
+};
+
ref4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload9.C
===================================================================
--- overload9.C (nonexistent)
+++ overload9.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/32232
+
+template struct A;
+template struct B {};
+template A& operator<<(A&, const B&);
+
+template
+struct A
+{
+ A& operator<<(A& (*)(A&));
+};
+
+template A& foo(A&);
+extern A c;
+
+int main () {
+ c << (1, foo); // { dg-error "no context" }
+}
overload9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond2.C
===================================================================
--- cond2.C (nonexistent)
+++ cond2.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/11962
+// { dg-options "" }
+
+template class c;
+
+template int test(c&); // { dg-error "omitted" }
+
+void test(c<2>*c2) {
+ test<0, 2>(*c2); // { dg-message "instantiated" }
+}
cond2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem10.C
===================================================================
--- ptrmem10.C (nonexistent)
+++ ptrmem10.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/15096
+
+template
+class C1
+{
+public:
+ C1 ();
+ ~C1 ();
+ const int C1::* getPtr () const;
+
+private:
+ int x;
+ T_ y;
+};
+
+
+template
+const int C1::* C1::getPtr () const
+{ return &C1::x; }
+
+
ptrmem10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using1.C
===================================================================
--- using1.C (nonexistent)
+++ using1.C (revision 338)
@@ -0,0 +1,42 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003
+
+// PR 9447. Using decls in template classes.
+
+template
+struct Foo {
+ int i;
+};
+
+struct Baz
+{
+ int j;
+};
+
+template
+struct Bar : public Foo, Baz {
+ using Foo::i;
+ using Baz::j;
+
+ int foo () { return i; }
+ int baz () { return j; }
+};
+
+int main()
+{
+ Bar bar;
+
+ bar.i = 1;
+ bar.j = 2;
+
+ if (bar.foo() != 1)
+ return 1;
+
+ if (bar.baz() != 2)
+ return 1;
+
+ return 0;
+}
+
using1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash70.C
===================================================================
--- crash70.C (nonexistent)
+++ crash70.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/32113
+
+template struct A;
+
+template void foo (A<&T::template i>); // { dg-error "not a template" }
+
+template void foo > (A<0>); // { dg-error "does not match" }
crash70.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: const2.C
===================================================================
--- const2.C (nonexistent)
+++ const2.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/39608
+// We were improperly considering dependent members of the current
+// instantiation to be non-constant (and therefore invalid template
+// non-type arguments).
+
+template
+struct C {};
+
+template
+struct A
+{
+ static const T x = 1;
+ C::x> c; // { dg-bogus "invalid" }
+};
+
+A a;
const2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash53.C
===================================================================
--- crash53.C (nonexistent)
+++ crash53.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/28110
+// { dg-do compile }
+
+template struct A {};
+
+template struct B
+{
+ template B(A); // { dg-error "template constant parameter" }
+};
+
+B a=A<0>(); // { dg-error "non-scalar type" }
crash53.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pretty1.C
===================================================================
--- pretty1.C (nonexistent)
+++ pretty1.C (revision 338)
@@ -0,0 +1,43 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Sep 2002
+
+// PR 7768 template dtor pretty function wrong
+
+#include
+
+static size_t current = 0;
+static bool error = false;
+
+static char const *names[] =
+{
+ "X::X() [with T = void]",
+ "X::~X() [with T = void]",
+ 0
+};
+
+void Verify (char const *ptr)
+{
+ error = strcmp (ptr, names[current++]);
+}
+
+template
+struct X
+{
+ X() { Verify (__PRETTY_FUNCTION__); }
+ ~X() { Verify (__PRETTY_FUNCTION__); }
+};
+
+int main()
+{
+ {
+ X x;
+
+ if (error)
+ return current;
+ }
+ if (error)
+ return current;
+ return 0;
+}
pretty1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: stmtexpr2.C
===================================================================
--- stmtexpr2.C (nonexistent)
+++ stmtexpr2.C (revision 338)
@@ -0,0 +1,26 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/36408
+// { dg-options "" }
+// { dg-do compile }
+
+template
+void
+foo()
+{
+ int i = ({ }); // { dg-error "void value not ignored" }
+}
+
+template
+void
+bar()
+{
+ int i = ({ ({}); }); // { dg-error "void value not ignored" }
+}
+
+int
+main ()
+{
+ foo<0> ();
+ bar<0> ();
+}
+
stmtexpr2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash36.C
===================================================================
--- crash36.C (nonexistent)
+++ crash36.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+// Andrew Pinski
+
+// PR c++/20333: ICE parsing typename without nested-name-specifier
+
+template struct f {};
+f f2[2] = {typename f()}; // { dg-error "" }
crash36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef27.C
===================================================================
--- typedef27.C (nonexistent)
+++ typedef27.C (revision 338)
@@ -0,0 +1,55 @@
+// Origin: PR c++/42713
+// { dg-do compile }
+
+template
+struct S
+{
+};
+
+template
+struct S0
+{
+ typedef T TT;
+};
+
+template
+struct super_struct : S0
+{
+ typedef S0 super;
+};
+
+template
+struct S1 : super_struct
+{
+ typedef super_struct super;
+ typedef typename super::super Super2;
+ typedef typename Super2::TT Super2TT;
+ void
+ foo()
+ {
+ S s1;
+ }
+};
+
+template
+struct S2 : super_struct
+{
+ typedef super_struct super;
+ typedef typename super::super Super2;
+ typedef typename Super2::TT Super2TT;
+ void
+ foo()
+ {
+ S s1;
+ }
+};
+
+int
+main()
+{
+ S1, int> s1;
+ s1.foo();
+ S2 > s2;
+ s2.foo();
+}
+
typedef27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash19.C
===================================================================
--- crash19.C (nonexistent)
+++ crash19.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/15165
+
+struct S
+{
+ template S(const T &e);
+};
+int operator *(const double, const S &);
+template
+struct X {
+ enum { SIXTY_FOUR=64 };
+ struct node {
+ unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
+ void d() {}
+ };
+ node *head;
+};
+template struct X;
crash19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error3.C
===================================================================
--- error3.C (nonexistent)
+++ error3.C (revision 338)
@@ -0,0 +1,5 @@
+// PR 12762
+
+template struct A { A() {}};
+typedef A Ac;
+Ac a; // { dg-error "template" }
error3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload11.C
===================================================================
--- overload11.C (nonexistent)
+++ overload11.C (revision 338)
@@ -0,0 +1,27 @@
+// PR c++/39413
+// We don't need to instantiate Wrapper to check the
+// foo(const Thingy&) overload.
+
+template struct Incomplete;
+
+template class Wrapper
+{
+ Incomplete i;
+};
+
+template struct Thingy
+{
+ Thingy();
+ Thingy(const Wrapper& v);
+
+ template void foo(const Thingy&);
+ void foo(const Thingy&);
+};
+
+int main()
+{
+ Thingy ap1;
+ Thingy bp1;
+
+ ap1.foo(bp1);
+}
overload11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp3.C
===================================================================
--- qualttp3.C (nonexistent)
+++ qualttp3.C (revision 338)
@@ -0,0 +1,23 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> struct X
+{
+ TT y;
+};
+
+template struct C
+{
+ X x; // { dg-error "type" }
+};
+
+int main()
+{
+ C c; // { dg-message "instantiated" }
+}
qualttp3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec3.C
===================================================================
--- spec3.C (nonexistent)
+++ spec3.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/3870
+// Test that performing a type instantiation in order to match up a
+// specialization doesn't clobber last_function_parms.
+
+template
+struct A { typedef int I; };
+
+template
+inline typename T::I
+foo (typename T::I, const T*);
+
+template <>
+int foo (int i, const A*)
+{
+ return i + 1;
+}
spec3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend44.C
===================================================================
--- friend44.C (nonexistent)
+++ friend44.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-options "-fshow-column" }
+//PR c++/28260
+
+template struct A
+{
+ friend int foo(); // { dg-error "14:new declaration" }
+};
+
+void foo() { A<0> a; } // { dg-error "6:ambiguates old declaration" }
friend44.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify5.C
===================================================================
--- unify5.C (nonexistent)
+++ unify5.C (revision 338)
@@ -0,0 +1,10 @@
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Apr 2004
+// Origin:Matt Austern
+
+// PR:c++/14007
+
+template struct X {}; // #1
+template struct X; //#2
+template struct X; //#3
unify5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend27.C
===================================================================
--- friend27.C (nonexistent)
+++ friend27.C (revision 338)
@@ -0,0 +1,22 @@
+// PR c++/15265
+
+enum Relation {equalOp};
+template
+class A {
+public:
+ static
+ bool Relop(const A&, const A&, Relation);
+
+ friend
+ bool operator==(const A& a1, const A& a2) {
+ return Relop(a1, a2, equalOp);
+ }
+ B* b;
+};
+
+int main() {
+ A a; a == a;
+ return 0;
+}
+
+
friend27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof2.C
===================================================================
--- sizeof2.C (nonexistent)
+++ sizeof2.C (revision 338)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+template
+struct Foobar {
+ // Contents irrelevant
+};
+
+template
+struct Wrapper {
+ // Contents irrelevant
+};
+
+template
+Foobar)> *
+compiler_bug (A)
+{
+ return 0;
+}
+
+int main()
+{
+ compiler_bug(1);
+}
sizeof2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ntp1.C
===================================================================
--- ntp1.C (nonexistent)
+++ ntp1.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Dec 2001
+
+// PR 35. We were default promoting template PARM_DECLs
+
+template class R {};
+
+template class A
+{
+ public:
+ template
+ void operator() (R const &);
+};
+
+int main() {
+ A a;
+ R<1> r;
+
+ a (r);
+
+ return 0;
+}
ntp1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate10.C
===================================================================
--- instantiate10.C (nonexistent)
+++ instantiate10.C (revision 338)
@@ -0,0 +1,37 @@
+/* PR c++/39242, xplicit instantiation declaration prohibits implicit
+ instantiation of non-inline functions. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+class Rep {
+public:
+ void unref() const { }
+ static void unref (const Rep * obj_r) { obj_r->unref(); }
+};
+template
+class RepPtrStore {
+ _Tp * _obj;
+ void _assign( _Tp * new_r );
+public:
+ ~RepPtrStore() { _assign( 0 ); }
+};
+template
+void RepPtrStore<_Tp,_Bt>::_assign( _Tp * new_r )
+{
+ Rep::unref( _obj );
+}
+class RepPtrBase { };
+template class PtrBase : public RepPtrBase { };
+template
+class Ptr : public PtrBase<_Bt> {
+ RepPtrStore<_Tp,_Bt> _ptr;
+};
+class YCode;
+class YStatement;
+typedef Ptr YStatementPtr;
+extern template class RepPtrStore;
+class ExecutionEnvironment {
+ YStatementPtr m_statement;
+ ~ExecutionEnvironment() { };
+};
+
instantiate10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: elab1.C
===================================================================
--- elab1.C (nonexistent)
+++ elab1.C (revision 338)
@@ -0,0 +1,13 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+// Elaborate type specifier of class template
+
+template class A {
+ class B;
+};
+
+template class A::B {
+ friend class A;
+};
elab1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void3.C
===================================================================
--- void3.C (nonexistent)
+++ void3.C (revision 338)
@@ -0,0 +1,5 @@
+//PR c++/28637
+
+template struct A {}; // { dg-error "not a valid type" }
+A<0> a; // { dg-error "type" }
+
void3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit-instantiation2.C
===================================================================
--- explicit-instantiation2.C (nonexistent)
+++ explicit-instantiation2.C (revision 338)
@@ -0,0 +1,6 @@
+// Bug 10968: implicit instantiation overrides explicit instantiation
+// { dg-final { scan-assembler "_Z1fIiET_S0_" } }
+
+template T f (T t) { return t; }
+inline void g () { f (4); }
+template int f (int);
explicit-instantiation2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum3.C
===================================================================
--- enum3.C (nonexistent)
+++ enum3.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/17327
+
+enum E { E0, E1 };
+template class A {};
+template void f(A) {}
+// We used to issue a "sorry" message. By using an explicit error
+// message below, we make sure that we will not match "sorry".
+template void f(A); // { dg-error "template-id" }
enum3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array19.C
===================================================================
--- array19.C (nonexistent)
+++ array19.C (revision 338)
@@ -0,0 +1,22 @@
+// PR c++/33553
+// { dg-do compile }
+
+template struct S { static const int sz = 2; };
+template struct U { enum { sz = 2 }; };
+
+template
+struct P
+{
+ template void bar (int (&x)[S::sz]);
+ template void baz (int (&x)[U::sz]);
+};
+
+P p;
+
+void
+foo (void)
+{
+ int x[2];
+ p.bar (x);
+ p.baz (x);
+}
array19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem5.C
===================================================================
--- ptrmem5.C (nonexistent)
+++ ptrmem5.C (revision 338)
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Mar 2003
+
+// PR 10119 (part). We failed to tsubst the args of a template-id-expr
+
+template struct Good
+{
+ static int const value = 0;
+};
+
+struct A
+{
+ template void good ()
+ {
+ int s_id = Good >::value;
+ }
+};
+
+
+int main()
+{
+ A().good();
+}
ptrmem5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp2.C
===================================================================
--- ttp2.C (nonexistent)
+++ ttp2.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template struct Alloc {};
+
+template > struct Vector {};
+
+template > class TT>
+struct C {
+ TT tt;
+};
+
+int main()
+{
+ C c;
+}
ttp2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access9.C
===================================================================
--- access9.C (nonexistent)
+++ access9.C (revision 338)
@@ -0,0 +1,19 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+// Template instantiate during deferred access check
+
+template struct C {
+ typedef int Y;
+};
+
+template void f(typename T::X) {
+}
+
+class A {
+ typedef int X;
+ template friend void f(typename T::X);
+};
+
+C<&f >::Y g(int);
access9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using14.C
===================================================================
--- using14.C (nonexistent)
+++ using14.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/26102
+
+template struct B1 { int i(); };
+
+struct B2 { int i(); };
+
+template struct C : public B1, public B2
+{
+ using B2::i;
+ void f()
+ {
+ i(); // should be accepted
+ i.i(); // { dg-error "member" }
+ }
+};
+
+int main()
+{
+ C c;
+ c.f(); // { dg-message "instantiated" }
+}
using14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static22.C
===================================================================
--- static22.C (nonexistent)
+++ static22.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/26266
+
+template struct A
+{
+ static const int i = 1;
+ static const int j = i;
+ static const int k = int(j);
+ int x[k];
+};
+
+A a;
static22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv7.C
===================================================================
--- conv7.C (nonexistent)
+++ conv7.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-options "-fabi-version=0" }
+
+template struct S {
+ struct I{};
+ operator I* ();
+};
+
+template struct S2 : S {
+ operator typename S::I* ();
+};
+
+template struct S2;
conv7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae7.C
===================================================================
--- sfinae7.C (nonexistent)
+++ sfinae7.C (revision 338)
@@ -0,0 +1,199 @@
+// DR 339
+//
+// Test of the use of various binary operators with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#define DEFINE_INFIX_BINARY_TRAIT(Name,Op) \
+template \
+ typename enable_if<(sizeof(create_a() Op create_a(), 1) > 0), \
+ yes_type>::type \
+ JOIN(check_,Name)(type, type); \
+ \
+no_type JOIN(check_,Name)(...); \
+ \
+template \
+struct Name \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,Name)(type(), type())) == sizeof(yes_type)); \
+}
+
+template
+ typename enable_if<(sizeof(create_a()[create_a()], 1) > 0),
+ yes_type>::type
+ check_subscript(int);
+
+template
+ no_type check_subscript(...);
+
+template
+struct can_subscript
+{
+ static const bool value =
+ (sizeof(check_subscript(0)) == sizeof(yes_type));
+};
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct X { };
+struct Y { int operator[](X); };
+
+// is_addable
+DEFINE_INFIX_BINARY_TRAIT(is_addable, +);
+X operator+(X, X);
+X operator+(X, Y);
+STATIC_ASSERT((is_addable::value));
+STATIC_ASSERT((is_addable::value));
+STATIC_ASSERT((is_addable::value));
+STATIC_ASSERT((is_addable::value));
+STATIC_ASSERT((!is_addable::value));
+STATIC_ASSERT((is_addable::value));
+STATIC_ASSERT((!is_addable::value));
+
+// is_subtractable
+DEFINE_INFIX_BINARY_TRAIT(is_subtractable, -);
+X operator-(X, X);
+X operator-(X, Y);
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((is_subtractable::value));
+STATIC_ASSERT((!is_subtractable::value));
+STATIC_ASSERT((!is_subtractable::value));
+
+// is_multiplicable
+DEFINE_INFIX_BINARY_TRAIT(is_multiplicable, *);
+X operator*(X, X);
+X operator*(X, Y);
+STATIC_ASSERT((is_multiplicable::value));
+STATIC_ASSERT((is_multiplicable::value));
+STATIC_ASSERT((is_multiplicable::value));
+STATIC_ASSERT((!is_multiplicable::value));
+STATIC_ASSERT((!is_multiplicable::value));
+STATIC_ASSERT((is_multiplicable::value));
+STATIC_ASSERT((!is_multiplicable::value));
+STATIC_ASSERT((!is_multiplicable::value));
+
+// is_divisible
+DEFINE_INFIX_BINARY_TRAIT(is_divisible, /);
+X operator/(X, X);
+X operator/(X, Y);
+STATIC_ASSERT((is_divisible::value));
+STATIC_ASSERT((is_divisible::value));
+STATIC_ASSERT((is_divisible::value));
+STATIC_ASSERT((!is_divisible::value));
+STATIC_ASSERT((!is_divisible::value));
+STATIC_ASSERT((is_divisible::value));
+STATIC_ASSERT((!is_divisible::value));
+STATIC_ASSERT((!is_divisible::value));
+
+// has_remainder
+DEFINE_INFIX_BINARY_TRAIT(has_remainder, %);
+X operator%(X, X);
+X operator%(X, Y);
+STATIC_ASSERT((has_remainder::value));
+STATIC_ASSERT((has_remainder::value));
+STATIC_ASSERT((!has_remainder::value));
+STATIC_ASSERT((has_remainder::value));
+STATIC_ASSERT((!has_remainder::value));
+STATIC_ASSERT((!has_remainder::value));
+STATIC_ASSERT((has_remainder::value));
+STATIC_ASSERT((!has_remainder::value));
+STATIC_ASSERT((!has_remainder::value));
+
+// has_xor
+DEFINE_INFIX_BINARY_TRAIT(has_xor, ^);
+X operator^(X, X);
+X operator^(X, Y);
+STATIC_ASSERT((has_xor::value));
+STATIC_ASSERT((has_xor::value));
+STATIC_ASSERT((!has_xor::value));
+STATIC_ASSERT((has_xor::value));
+STATIC_ASSERT((!has_xor::value));
+STATIC_ASSERT((!has_xor::value));
+STATIC_ASSERT((has_xor::value));
+STATIC_ASSERT((!has_xor::value));
+STATIC_ASSERT((!has_xor::value));
+
+// has_bitand
+DEFINE_INFIX_BINARY_TRAIT(has_bitand, &);
+X operator&(X, X);
+X operator&(X, Y);
+STATIC_ASSERT((has_bitand::value));
+STATIC_ASSERT((has_bitand::value));
+STATIC_ASSERT((!has_bitand::value));
+STATIC_ASSERT((has_bitand::value));
+STATIC_ASSERT((!has_bitand::value));
+STATIC_ASSERT((!has_bitand::value));
+STATIC_ASSERT((has_bitand::value));
+STATIC_ASSERT((!has_bitand::value));
+STATIC_ASSERT((!has_bitand::value));
+
+// has_bitor
+DEFINE_INFIX_BINARY_TRAIT(has_bitor, |);
+X operator|(X, X);
+X operator|(X, Y);
+STATIC_ASSERT((has_bitor::value));
+STATIC_ASSERT((has_bitor::value));
+STATIC_ASSERT((!has_bitor::value));
+STATIC_ASSERT((has_bitor::value));
+STATIC_ASSERT((!has_bitor::value));
+STATIC_ASSERT((!has_bitor::value));
+STATIC_ASSERT((has_bitor::value));
+STATIC_ASSERT((!has_bitor::value));
+STATIC_ASSERT((!has_bitor::value));
+
+// has_left_shift
+DEFINE_INFIX_BINARY_TRAIT(has_left_shift, <<);
+X operator<<(X, X);
+X operator<<(X, Y);
+STATIC_ASSERT((has_left_shift::value));
+STATIC_ASSERT((has_left_shift::value));
+STATIC_ASSERT((!has_left_shift::value));
+STATIC_ASSERT((has_left_shift::value));
+STATIC_ASSERT((!has_left_shift::value));
+STATIC_ASSERT((!has_left_shift::value));
+STATIC_ASSERT((has_left_shift::value));
+STATIC_ASSERT((!has_left_shift::value));
+STATIC_ASSERT((!has_left_shift::value));
+
+// has_right_shift
+DEFINE_INFIX_BINARY_TRAIT(has_right_shift, >>);
+X operator>>(X, X);
+X operator>>(X, Y);
+STATIC_ASSERT((has_right_shift::value));
+STATIC_ASSERT((has_right_shift::value));
+STATIC_ASSERT((!has_right_shift::value));
+STATIC_ASSERT((has_right_shift::value));
+STATIC_ASSERT((!has_right_shift::value));
+STATIC_ASSERT((!has_right_shift::value));
+STATIC_ASSERT((has_right_shift::value));
+STATIC_ASSERT((!has_right_shift::value));
+STATIC_ASSERT((!has_right_shift::value));
+
+// can_subscript
+STATIC_ASSERT((can_subscript::value));
+STATIC_ASSERT((can_subscript::value));
+STATIC_ASSERT((can_subscript::value));
+STATIC_ASSERT((can_subscript::value));
+STATIC_ASSERT((!can_subscript::value));
+STATIC_ASSERT((can_subscript::value));
sfinae7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error31.C
===================================================================
--- error31.C (nonexistent)
+++ error31.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/33493
+
+template void foo() { delete 0 ? 1 : 0; } // { dg-error "delete 0" }
error31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtmpl3.C
===================================================================
--- memtmpl3.C (nonexistent)
+++ memtmpl3.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/33239
+
+struct null_type;
+
+template
+struct tuple_impl
+{
+ template
+ struct append
+ {
+ typedef tuple_impl type;
+ };
+
+ int data;
+};
+
+template
+class tuple
+: public tuple_impl::template append::type
+{
+ using tuple_impl::template append::type::data;
+};
+
+tuple my_tuple;
memtmpl3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error14.C
===================================================================
--- error14.C (nonexistent)
+++ error14.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/16904
+
+template struct X
+{
+ X() { this->T::i; } // { dg-error "" }
+};
+
+X x;
error14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp22.C
===================================================================
--- qualttp22.C (nonexistent)
+++ qualttp22.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Origin: Philippe Van Deyck
+
+// PR c++/13520: Default template template argument that is a qualified id
+// with dependent scope.
+
+template class Policy {};
+
+template class OriginalPolicy>
+class ChangedPolicy_impl {};
+
+template class OriginalPolicy > class ChangedPolicy {
+public:
+ template class Type : public
+ ChangedPolicy_impl { };
+};
+
+template class Policy1,
+ template class Policy2
+ = ChangedPolicy::template Type>
+class Host : public Policy1, public Policy2 { };
+
+int main()
+{
+ Host h;
+ return 0;
+}
qualttp22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec22.C
===================================================================
--- spec22.C (nonexistent)
+++ spec22.C (revision 338)
@@ -0,0 +1,21 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Apr 2005
+
+// PR 20723
+// Origin: Andrew Pinski
+// Nathan Sidwell
+
+template class srp;
+template struct ptr
+{
+ template ptr(const srp &other); // { dg-message "ptr::ptr" }
+};
+template struct srp
+{
+ template operator ptr(void) const; // { dg-message "srp::operator" }
+};
+ptr parent_get()
+{
+ srp parent;
+ return parent; // { dg-error "is ambiguous" }
+}
spec22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof10.C
===================================================================
--- sizeof10.C (nonexistent)
+++ sizeof10.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/23357
+
+template bool foo()
+{
+ const long int i = sizeof(T) > 1 ? sizeof(T) : 0;
+ return i > 0;
+}
sizeof10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array3.C
===================================================================
--- array3.C (nonexistent)
+++ array3.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// Origin: Graeme Prentice
+// PR c++/13474: An array domain which is value-dependent must be folded
+// in time for deduction.
+
+template< int X, int Y, int (*array_ptr)[Y] >
+class A;
+
+int array[5];
+
+template< int X >
+class A {};
+
+int main()
+{
+ A<6,5,&array> z1;
+}
array3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void10.C
===================================================================
--- void10.C (nonexistent)
+++ void10.C (revision 338)
@@ -0,0 +1,10 @@
+//PR c++/28736
+
+template struct A // { dg-error "not a valid type" }
+{
+ template friend struct B;
+};
+
+template struct B {};
+
+B b;
void10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access16.C
===================================================================
--- access16.C (nonexistent)
+++ access16.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/23842
+
+struct S;
+extern S *p;
+template int f(T*, int y = ((T*)p)->x) {
+ return y;
+}
+struct S {
+private:
+ int x;
+ template friend int f(U*, int);
+};
+int g() {
+ return f(p);
+}
+
access16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash62.C
===================================================================
--- crash62.C (nonexistent)
+++ crash62.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/29728
+
+template void foo()
+{
+ int a[] = { X: 0 }; // { dg-error "designated initializer" }
+}
crash62.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae12.C
===================================================================
--- sfinae12.C (nonexistent)
+++ sfinae12.C (revision 338)
@@ -0,0 +1,47 @@
+// DR 339
+//
+// Test of the use of the ternary operator with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+template
+typename enable_if<
+ (sizeof((create_a()? create_a() : create_a()), 0) > 0),
+ yes_type>::type
+ check_ternary(int);
+
+template no_type check_ternary(...);
+
+template
+struct has_ternary
+{
+ static const bool value =
+ (sizeof(check_ternary(0)) == sizeof(yes_type));
+};
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct X { };
+struct Y { operator bool(); };
+
+STATIC_ASSERT((has_ternary::value));
+STATIC_ASSERT((has_ternary::value));
+STATIC_ASSERT((!has_ternary::value));
+STATIC_ASSERT((!has_ternary::value));
+STATIC_ASSERT((has_ternary::value));
sfinae12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash45.C
===================================================================
--- crash45.C (nonexistent)
+++ crash45.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/26365
+
+struct A {};
+
+namespace N
+{
+ template void foo();
+}
+
+void bar(A *p)
+{
+ p->N::foo<0>; // { dg-error "not a member" }
+}
crash45.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static2.C
===================================================================
--- static2.C (nonexistent)
+++ static2.C (revision 338)
@@ -0,0 +1,17 @@
+class A;
+
+template
+class B
+{
+public:
+ static int A::* const p = P; // { dg-error "" }
+};
+
+class A
+{
+public:
+
+int dummy;
+
+B<&A::dummy> d;
+};
static2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash28.C
===================================================================
--- crash28.C (nonexistent)
+++ crash28.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/18445
+
+struct a
+{
+ int what();
+};
+void g(void*);
+template
+void f()
+{
+ a ex;
+ g(ex.what); // { dg-error "" }
+}
crash28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef19.C
===================================================================
--- typedef19.C (nonexistent)
+++ typedef19.C (revision 338)
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/40007
+// { dg-do compile }
+
+class A
+{
+ typedef int mytype; // { dg-error "'typedef int A::mytype' is private" }
+};
+
+template
+class B : public A
+{
+};
+
+template
+class B : public A
+{
+ mytype mem; // { dg-error "within this context" }
+};
+
+B b;
typedef19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename8.C
===================================================================
--- typename8.C (nonexistent)
+++ typename8.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/18738
+
+namespace foo {
+ typedef int my_type;
+}
+
+template
+struct A {
+ typename foo::my_type bar();
+};
typename8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new5.C
===================================================================
--- new5.C (nonexistent)
+++ new5.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/27210
+
+template class junk {
+ void bar(int a)
+ {
+ unsigned char *c = new unsigned char[a*sizeof(foo)];
+ }
+};
+
new5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend36.C
===================================================================
--- friend36.C (nonexistent)
+++ friend36.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/22139
+// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
+
+template class Tensor;
+template struct SymmetricTensor {
+ SymmetricTensor (const Tensor<2,dim> &t);
+ friend void foo();
+};
+template <> SymmetricTensor<2,2>::SymmetricTensor (const Tensor<2,2> &t) {}
+template <> SymmetricTensor<2,3>::SymmetricTensor (const Tensor<2,3> &t) {}
friend36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend19.C
===================================================================
--- friend19.C (nonexistent)
+++ friend19.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Origin: Benjamin Li
+
+// PR c++/11030: Template substitution of friend class that is
+// a specialization.
+
+template
+struct A
+{
+ void func(void);
+};
+
+template
+class C
+{
+ static void private_func(void) {}
+public:
+ friend class A<512>;
+};
+
+template
+void A::func(void)
+{
+ C::private_func();
+}
+
+template class A<512>;
friend19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator8.C
===================================================================
--- operator8.C (nonexistent)
+++ operator8.C (revision 338)
@@ -0,0 +1,6 @@
+//PR c++/27494
+
+struct A
+{
+ template void foo() {} // { dg-error "identifier|non-function|template arguments" }
+};
operator8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init5.C
===================================================================
--- init5.C (nonexistent)
+++ init5.C (revision 338)
@@ -0,0 +1,11 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 May 2005
+
+// PR 21165. ICE on valid
+// Origin:Volker Reichelt reichelt@gcc.gnu.org
+
+template bool foo()
+{
+ const int i = T();
+ return i > 0;
+}
init5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: decl3.C
===================================================================
--- decl3.C (nonexistent)
+++ decl3.C (revision 338)
@@ -0,0 +1,8 @@
+// c++/32560
+
+namespace N {}
+
+template struct A
+{
+ int A; // { dg-error "namespace|argument|before" }
+};
decl3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static31.C
===================================================================
--- static31.C (nonexistent)
+++ static31.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/32674
+
+class C
+{
+ static const int j = 3;
+};
+
+template class A
+{
+ static const int i1;
+ static const int i2;
+ static const int i3;
+ static const int i4;
+};
+
+template const int A::i1(C::j);
+template const int A::i2 = C::j;
+template const int A::i3(C::j, 5); // { dg-error "compound expression" }
+template const int A::i4 = (C::j, 7);
static31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static14.C
===================================================================
--- static14.C (nonexistent)
+++ static14.C (revision 338)
@@ -0,0 +1,13 @@
+struct Base {
+ int x;
+};
+
+template
+struct A {
+ static const int N = sizeof(static_cast (T()));
+ int a[N];
+};
+
+struct Derived : Base {
+ A a;
+};
static14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig1.C
===================================================================
--- koenig1.C (nonexistent)
+++ koenig1.C (revision 338)
@@ -0,0 +1,8 @@
+namespace NS {
+ struct C {};
+ void foo(C);
+}
+
+template void bar() { T t; foo (t); }
+
+template void bar ();
koenig1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error40.C
===================================================================
--- error40.C (nonexistent)
+++ error40.C (revision 338)
@@ -0,0 +1,30 @@
+// { dg-options "-fno-pretty-templates" }
+
+template
+struct A
+{
+ struct AN;
+};
+
+void foo(void)
+{
+ A a = 0; // { dg-error "A" }
+}
+
+template T f(T); // { dg-message "int f.int." }
+template T f(T, int = 0); // { dg-message "" }
+
+template
+struct B
+{
+ typedef typename T::AN BN;
+
+ BN f(); // { dg-message "AN" }
+ BN f(int = 0); // { dg-message "" }
+};
+
+int main()
+{
+ f(1); // { dg-error "" }
+ B >().f(); // { dg-error "" }
+}
error40.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg4.C
===================================================================
--- arg4.C (nonexistent)
+++ arg4.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/23437
+
+template struct S {
+ static const int i = 10;
+};
+
+void g();
+
+int a[S::i];
arg4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error23.C
===================================================================
--- error23.C (nonexistent)
+++ error23.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/29632
+
+struct nullptr_type {
+
+ nullptr_type ( void ) {}
+
+ template < typename T >
+ operator T* ( void ) const {
+ return ( 0 );
+ }
+} const nullptr;
+
+int main ( void ) {
+ 0 == nullptr; // { dg-error "match" }
+}
+
+
error23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec31.C
===================================================================
--- spec31.C (nonexistent)
+++ spec31.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/28058
+
+template struct A
+{
+ A() {}
+};
+
+A<0> a;
+
+template<> A<0>::A() {} // { dg-error "specialization" }
spec31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp14.C
===================================================================
--- qualttp14.C (nonexistent)
+++ qualttp14.C (revision 338)
@@ -0,0 +1,30 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do link }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT, class T> struct X
+{
+ TT y;
+ T z;
+};
+
+template struct X
+{
+ typename T::template B y;
+ T z;
+};
+
+template struct C
+{
+ X x;
+};
+
+int main()
+{
+ C c;
+}
qualttp14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec14.C
===================================================================
--- spec14.C (nonexistent)
+++ spec14.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin:
+// PR c++/3671: Non-type enum parameters must not be converted
+
+enum T1 {a};
+enum T2 {b};
+
+struct Y {
+ template void foo() {}
+ template void foo() {}
+};
+
+struct Z {
+ template void foo() {}
+};
+
+template void Y::foo ();
+template void Z::foo (); // { dg-error "" }
spec14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ref5.C
===================================================================
--- ref5.C (nonexistent)
+++ ref5.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/35075
+
+template struct A {};
+
+template struct B
+{
+ static const T t;
+ A a; // { dg-error "reference variable" }
+};
+
+B b; // { dg-message "instantiated" }
ref5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inherit.C
===================================================================
--- inherit.C (nonexistent)
+++ inherit.C (revision 338)
@@ -0,0 +1,13 @@
+// Contributed by Gabriel Dos Reis
+// { dg-do compile }
+
+template
+struct X { void f() { } };
+
+struct Z : X { };
+
+int main()
+{
+ Z z;
+ z.X::f();
+}
inherit.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: type1.C
===================================================================
--- type1.C (nonexistent)
+++ type1.C (revision 338)
@@ -0,0 +1,8 @@
+// Test for helpful error messages on invalid nested-name-specifiers.
+
+struct A {
+ template struct B { static int c; };
+};
+
+int A::B::c; // { dg-error "parameters" }
+int A::C::d; // { dg-error "declared" }
type1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond3.C
===================================================================
--- cond3.C (nonexistent)
+++ cond3.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/13833
+
+struct X {
+ template
+ X & operator << (const T &t);
+ X & operator<< (int& (*p) (int&));
+};
+
+X x;
+
+template void foo () {
+ x << (1 ? "ok" : "failed");
+}
+
+template void foo<1>();
cond3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem11.C
===================================================================
--- ptrmem11.C (nonexistent)
+++ ptrmem11.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/18407
+
+template
+struct the_base{
+ template void foo() { }
+};
+
+template
+struct derivedT: the_base > {
+ typedef the_base > parent;
+ void ice(){
+ this->parent::template foo< &derivedT::ice>();
+ }
+};
+
+int main() {
+ derivedT dT;
+ dT.ice();
+}
ptrmem11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using2.C
===================================================================
--- using2.C (nonexistent)
+++ using2.C (revision 338)
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003
+
+// PR 9447. Using decls in template classes.
+
+template
+struct Foo {
+ int i; // { dg-error "Foo" }
+};
+
+struct Baz
+{
+ int i; // { dg-error "Baz" }
+};
+
+template
+struct Bar : public Foo, Baz {
+ using Foo::i;
+ using Baz::i;
+
+ int foo () { return i; } // { dg-error "request for member" }
+};
+
+void foo (Bar &bar)
+{
+ bar.foo(); // { dg-message "instantiated" }
+}
+
using2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash71.C
===================================================================
--- crash71.C (nonexistent)
+++ crash71.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/30659
+
+extern "C" template A foo(); // { dg-error "forbids|static data|expected" }
crash71.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: const3.C
===================================================================
--- const3.C (nonexistent)
+++ const3.C (revision 338)
@@ -0,0 +1,20 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/42251
+// { dg-do "compile" }
+
+struct foo
+{
+ static const bool b = false;
+};
+
+template
+struct S1
+{
+};
+
+template
+struct S2
+ : S1
+{
+};
+
const3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash54.C
===================================================================
--- crash54.C (nonexistent)
+++ crash54.C (revision 338)
@@ -0,0 +1,5 @@
+//PR c++/28269
+
+template struct A;
+
+struct __attribute__((unused)) A<0<; // { dg-error "template argument|unqualified-id" }
crash54.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash37.C
===================================================================
--- crash37.C (nonexistent)
+++ crash37.C (revision 338)
@@ -0,0 +1,26 @@
+// PR c++/21352
+
+struct coperator_stack
+{
+ template
+ void push3()
+ {
+ }
+};
+
+struct helper {};
+
+template
+void bla(F f) // { dg-message "candidate is" }
+{
+}
+
+template
+struct definition
+{
+ definition()
+ {
+ bla(coperator_stack::push3); // { dg-error "matching" }
+ }
+};
+
crash37.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: deduce1.C
===================================================================
--- deduce1.C (nonexistent)
+++ deduce1.C (revision 338)
@@ -0,0 +1,25 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 13 Sep 2002
+
+template int Foo (T const *)
+{
+ return 1;
+}
+template int Foo (T const &)
+{
+ return 2;
+}
+template int Foo (T const (&ref)[I])
+{
+ return 0;
+}
+
+int main ()
+{
+ static int array[4] = {};
+
+ return Foo (array);
+}
+
deduce1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef28.C
===================================================================
--- typedef28.C (nonexistent)
+++ typedef28.C (revision 338)
@@ -0,0 +1,28 @@
+// Origin: PR c++/42820
+// { dg-do compile }
+
+
+template struct vector{};
+struct Traits{struct Primitive{struct Id{};};};
+
+template struct Tree_vs_naive
+{
+ typedef typename Tree::Primitive Primitive;
+
+ void f() const
+ {
+ typedef vector Id_vector;
+ }
+};
+
+template void test_hint_strategies()
+{
+ vector v;
+}
+
+int main(void)
+{
+ test_hint_strategies();
+}
+
+
typedef28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error4.C
===================================================================
--- error4.C (nonexistent)
+++ error4.C (revision 338)
@@ -0,0 +1,9 @@
+template struct C1
+{
+ template struct C2
+ { class Type { }; };
+};
+
+template
+void foo(typename C1::C2::Type *) { } // { dg-error "template" "error " }
+// { dg-message "note" "note" { target *-*-* } 8 }
error4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: eh1.C
===================================================================
--- eh1.C (nonexistent)
+++ eh1.C (revision 338)
@@ -0,0 +1,6 @@
+template
+void foo()
+{
+ try {}
+ catch(T e) {}
+}
eh1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp4.C
===================================================================
--- qualttp4.C (nonexistent)
+++ qualttp4.C (revision 338)
@@ -0,0 +1,24 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template struct B {};
+};
+
+template class TT> // { dg-error "provided" }
+struct X
+{
+ TT y; // { dg-error "number" }
+};
+
+template struct C
+{
+ X x; // { dg-error "type" }
+};
+
+int main()
+{
+ C c; // { dg-message "instantiated" }
+}
qualttp4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec4.C
===================================================================
--- spec4.C (nonexistent)
+++ spec4.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+
+// PR c++/2863
+// Default function argument and template specialization.
+
+struct X {
+ template void f(int=0);
+};
+
+template <> void X::f<1> () {} // { dg-error "(not match|declaration)" }
spec4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend45.C
===================================================================
--- friend45.C (nonexistent)
+++ friend45.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/28025
+
+class BaseSubmit
+{
+ template friend class PeriodicSubmit;
+};
+
+template
+class ValuesSubmit
+{
+ template friend class PeriodicSubmit;
+};
+
+class A;
+class MultiSubmit : public ValuesSubmit
+{
+};
friend45.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify6.C
===================================================================
--- unify6.C (nonexistent)
+++ unify6.C (revision 338)
@@ -0,0 +1,22 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Apr 2004
+
+void Baz ();
+
+template void Foo1 (T *); // #1
+template void Foo1 (T const *a) {a (1);} // #2
+
+template T const *Foo2 (T *);
+
+template void Foo3 (T *, T const * = 0);
+
+void Bar ()
+{
+ Foo1 (&Baz); // #1
+
+ Foo2 (&Baz);
+
+ Foo3 (&Baz);
+
+ Foo3 (&Baz, &Baz); // { dg-error "no matching function" "" }
+}
unify6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend28.C
===================================================================
--- friend28.C (nonexistent)
+++ friend28.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/15629
+// { dg-do link }
+
+template class T;
+
+template void func(T * t);
+template void func(T * t) {}
+template void func<2>(T<2, 3>*);
+
+template struct T {
+ friend void func(T * t);
+ friend void func (T * t);
+
+ void foo();
+};
+
+template void T::foo() {
+ func((T<2,3>*)0);
+}
+
+int main() {
+ T<2,3>().foo();
+}
friend28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof3.C
===================================================================
--- sizeof3.C (nonexistent)
+++ sizeof3.C (revision 338)
@@ -0,0 +1,13 @@
+// The call to f is not potentially evaluated (3.2), so f is not used,
+// so it should not be instantiated.
+
+template
+T f (T)
+{
+ typename T::X x;
+}
+
+int main()
+{
+ int i = sizeof (f(0));
+}
sizeof3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ntp2.C
===================================================================
--- ntp2.C (nonexistent)
+++ ntp2.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Dec 2002
+
+// PR 3784: We were confusing non-type template parms.
+
+template class X { };
+
+template void foo1(X);
+template void foo2(X);
+
+int main() {
+ X<2> x;
+ foo2(x);
+}
ntp2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate11.C
===================================================================
--- instantiate11.C (nonexistent)
+++ instantiate11.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/42608
+// { dg-do compile }
+
+template
+struct A;
+
+template
+struct A
+{
+ void f ();
+};
+
+template struct A;
+
+int
+main ()
+{
+ A a;
+ a.f ();
+ return 0;
+}
+
+// Make sure we get undefined reference error if
+// A::f () isn't instantiated elsewhere.
+// { dg-final { scan-assembler-not "weak\[\n\t\]*_ZN1AIiiE1fEv" } }
instantiate11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void4.C
===================================================================
--- void4.C (nonexistent)
+++ void4.C (revision 338)
@@ -0,0 +1,7 @@
+//PR c++/28638
+
+template struct A; // { dg-error "not a valid type" }
+
+template class> struct B {};
+
+B b; // { dg-error "template|invalid type" }
void4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit-instantiation3.C
===================================================================
--- explicit-instantiation3.C (nonexistent)
+++ explicit-instantiation3.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// Origin:
+// c++/8266: Explicit instantiation of a template outside its namespace is
+// broken
+
+namespace N
+{
+ template T foo (T)
+ { return T (); }
+
+ struct A
+ {
+ template
+ struct B {};
+ };
+
+ template
+ struct C {};
+
+ template double foo(double);
+ template float foo(float);
+ template struct A::B<0>;
+ template struct C<0>;
+}
+
+template int N::foo(int);
+template char N::foo(char);
+template struct N::A::B<1>;
+template struct N::C<1>;
+
+
explicit-instantiation3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum4.C
===================================================================
--- enum4.C (nonexistent)
+++ enum4.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/18020
+
+template struct bar {
+ enum {
+ e1 = 1,
+ e2 = ~e1
+ };
+};
+template struct bar;
enum4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup1.C
===================================================================
--- lookup1.C (nonexistent)
+++ lookup1.C (revision 338)
@@ -0,0 +1,17 @@
+template
+class A {
+public:
+ class B;
+};
+
+template
+class A::B {
+public:
+ class C;
+};
+
+template
+class A::B::C {
+public:
+ A &a;
+};
lookup1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem6.C
===================================================================
--- ptrmem6.C (nonexistent)
+++ ptrmem6.C (revision 338)
@@ -0,0 +1,10 @@
+struct S {};
+
+void g(int S::**);
+
+template
+void f (int T::* volatile *p) {
+ g(p); // { dg-error "conversion" }
+}
+
+template void f(int S::* volatile *); // { dg-message "instantiated" }
ptrmem6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp3.C
===================================================================
--- ttp3.C (nonexistent)
+++ ttp3.C (revision 338)
@@ -0,0 +1,26 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 5213. We failed to spot that class List was a template, rather
+// than a non-template or specialization
+
+
+template class vector { };
+
+class OUTER {
+ public:
+ template
+ class List { };
+
+ vector data; // { dg-error "invalid|required|ISO C" "" }
+};
+
+template
+class List { };
+
+// This next line should just do a lookup of 'class List', and then
+// get a type/value mismatch. Instead we try and push 'class List'
+// into the global namespace and get a redeclaration error.
+vector data; // { dg-error "invalid|required|declaration" "" }
ttp3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using15.C
===================================================================
--- using15.C (nonexistent)
+++ using15.C (revision 338)
@@ -0,0 +1,25 @@
+// Reduced from the testcase for c++/29433
+
+template
+struct A: T
+{
+ void f(typename T::type);
+ using T::f;
+ void g() { f(1); }
+};
+
+template
+struct B: T
+{ typedef int type; };
+
+struct C
+{
+ typedef double type;
+ void f();
+};
+
+int main()
+{
+ A > > a;
+ a.g();
+}
using15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static23.C
===================================================================
--- static23.C (nonexistent)
+++ static23.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/26266
+
+template struct A
+{
+ static const int i = 1;
+};
+
+template struct B
+{
+ static const int j = A::i;
+ static const int k = int(j);
+ int x[k];
+};
+
+B b;
static23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv8.C
===================================================================
--- conv8.C (nonexistent)
+++ conv8.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-options "-fabi-version=1 -Wno-abi" }
+
+template struct S {
+ struct I{};
+ operator I* ();
+};
+
+template struct S2 : S {
+ operator typename S::I* ();
+};
+
+template struct S2;
conv8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae8.C
===================================================================
--- sfinae8.C (nonexistent)
+++ sfinae8.C (revision 338)
@@ -0,0 +1,182 @@
+// DR 339
+//
+// Test of the use of various boolean binary operators with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+bool accepts_bool(bool);
+
+#define DEFINE_BINARY_PREDICATE_TRAIT(Name,Op) \
+template \
+ typename enable_if() Op create_a())), \
+ yes_type>::type \
+ JOIN(check_,Name)(type, type); \
+ \
+no_type JOIN(check_,Name)(...); \
+ \
+template \
+struct Name \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,Name)(type(), type())) == sizeof(yes_type)); \
+}
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct X { };
+struct Y { };
+
+struct convertible_to_bool {
+ operator int convertible_to_bool::* ();
+};
+
+struct not_convertible_to_bool { };
+
+// is_less_than_comparable
+DEFINE_BINARY_PREDICATE_TRAIT(is_less_than_comparable,<);
+bool operator<(X, X);
+convertible_to_bool operator<(X, Y);
+not_convertible_to_bool operator<(Y, X);
+
+STATIC_ASSERT((is_less_than_comparable::value));
+STATIC_ASSERT((is_less_than_comparable::value));
+STATIC_ASSERT((is_less_than_comparable::value));
+STATIC_ASSERT((is_less_than_comparable::value));
+STATIC_ASSERT((is_less_than_comparable::value));
+STATIC_ASSERT((!is_less_than_comparable::value));
+STATIC_ASSERT((!is_less_than_comparable::value));
+
+// is_less_equal_comparable
+DEFINE_BINARY_PREDICATE_TRAIT(is_less_equal_comparable,<=);
+bool operator<=(X, X);
+convertible_to_bool operator<=(X, Y);
+not_convertible_to_bool operator<=(Y, X);
+
+STATIC_ASSERT((is_less_equal_comparable::value));
+STATIC_ASSERT((is_less_equal_comparable::value));
+STATIC_ASSERT((is_less_equal_comparable::value));
+STATIC_ASSERT((is_less_equal_comparable::value));
+STATIC_ASSERT((is_less_equal_comparable::value));
+STATIC_ASSERT((!is_less_equal_comparable::value));
+STATIC_ASSERT((!is_less_equal_comparable::value));
+
+// is_greater_than_comparable
+DEFINE_BINARY_PREDICATE_TRAIT(is_greater_than_comparable,>);
+bool operator>(X, X);
+convertible_to_bool operator>(X, Y);
+not_convertible_to_bool operator>(Y, X);
+
+STATIC_ASSERT((is_greater_than_comparable::value));
+STATIC_ASSERT((is_greater_than_comparable::value));
+STATIC_ASSERT((is_greater_than_comparable::value));
+STATIC_ASSERT((is_greater_than_comparable::value));
+STATIC_ASSERT((is_greater_than_comparable::value));
+STATIC_ASSERT((!is_greater_than_comparable::value));
+STATIC_ASSERT((!is_greater_than_comparable::value));
+
+// is_greater_equal_comparable
+DEFINE_BINARY_PREDICATE_TRAIT(is_greater_equal_comparable,>=);
+bool operator>=(X, X);
+convertible_to_bool operator>=(X, Y);
+not_convertible_to_bool operator>=(Y, X);
+
+STATIC_ASSERT((is_greater_equal_comparable::value));
+STATIC_ASSERT((is_greater_equal_comparable::value));
+STATIC_ASSERT((is_greater_equal_comparable::value));
+STATIC_ASSERT((is_greater_equal_comparable::value));
+STATIC_ASSERT((is_greater_equal_comparable::value));
+STATIC_ASSERT((!is_greater_equal_comparable::value));
+STATIC_ASSERT((!is_greater_equal_comparable::value));
+
+// is_equality_comparable
+struct Z : X { };
+DEFINE_BINARY_PREDICATE_TRAIT(is_equality_comparable,==);
+bool operator==(X, X);
+convertible_to_bool operator==(X, Y);
+not_convertible_to_bool operator==(Y, X);
+
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((!is_equality_comparable::value));
+STATIC_ASSERT((!is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((!is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((is_equality_comparable::value));
+STATIC_ASSERT((!is_equality_comparable::value));
+
+// is_not_equal_comparable
+DEFINE_BINARY_PREDICATE_TRAIT(is_not_equal_comparable,!=);
+bool operator!=(X, X);
+convertible_to_bool operator!=(X, Y);
+not_convertible_to_bool operator!=(Y, X);
+
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((!is_not_equal_comparable::value));
+STATIC_ASSERT((!is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((!is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((is_not_equal_comparable::value));
+STATIC_ASSERT((!is_not_equal_comparable::value));
+
+// has_logical_and
+DEFINE_BINARY_PREDICATE_TRAIT(has_logical_and,&&);
+bool operator&&(X, X);
+convertible_to_bool operator&&(X, Y);
+not_convertible_to_bool operator&&(Y, X);
+
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((!has_logical_and::value));
+STATIC_ASSERT((!has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+STATIC_ASSERT((has_logical_and::value));
+
+// has_logical_or
+DEFINE_BINARY_PREDICATE_TRAIT(has_logical_or,||);
+bool operator||(X, X);
+convertible_to_bool operator||(X, Y);
+not_convertible_to_bool operator||(Y, X);
+
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((!has_logical_or::value));
+STATIC_ASSERT((!has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
+STATIC_ASSERT((has_logical_or::value));
sfinae8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error32.C
===================================================================
--- error32.C (nonexistent)
+++ error32.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/33843
+
+struct A {};
+
+void foo(A* p())
+{
+ p->A::~A(); // { dg-error "A::~A" }
+}
error32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error15.C
===================================================================
--- error15.C (nonexistent)
+++ error15.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/16929
+
+template
+class A {
+ int x;
+};
+
+template
+class B {
+protected:
+
+ A a; // { dg-error "" }
+
+ void f(const A * a1 = &a); // { dg-error "this location" }
+
+ void g(void);
+};
+
+template
+void B::g(void) {
+ f(); // { dg-error "default argument" }
+}
+
+template class B;
error15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: op1.C
===================================================================
--- op1.C (nonexistent)
+++ op1.C (revision 338)
@@ -0,0 +1,12 @@
+template struct X {
+ typedef int type;
+};
+
+template struct O {
+ struct I {
+ operator typename X::type ();
+ };
+};
+
+template
+O::I::operator typename X::type () {}
op1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec23.C
===================================================================
--- spec23.C (nonexistent)
+++ spec23.C (revision 338)
@@ -0,0 +1,25 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Apr 2005
+
+// PR 20723
+// Origin: Andrew Pinski
+// Nathan Sidwell
+
+struct Foo
+{
+ template
+ Foo (const T &); // { dg-message "T = Bar" }
+};
+
+struct Bar
+{
+ template
+ operator T () const; // { dg-message "T = Foo" }
+};
+
+Foo Quux (Bar const &b)
+{
+ return b; // { dg-error "ambiguous" }
+}
+
+
spec23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof11.C
===================================================================
--- sizeof11.C (nonexistent)
+++ sizeof11.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/29435
+
+template < class T > struct A {};
+template < int> void g()
+{
+ sizeof (A < int>);
+}
+
+template < class T > struct B;
+template < int> void f()
+{
+ sizeof (B); // { dg-error "incomplete" }
+}
+
sizeof11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array4.C
===================================================================
--- array4.C (nonexistent)
+++ array4.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/14122
+
+extern const char str[];
+
+template
+struct A
+{
+ template void foo();
+};
+
+template class A;
array4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void11.C
===================================================================
--- void11.C (nonexistent)
+++ void11.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/31446
+
+template struct A // { dg-error "valid type" }
+
+{
+ template friend void foo();
+};
+
+void bar()
+{
+ foo<0>(); // { dg-error "not declared|primary-expression" }
+}
void11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name1.C
===================================================================
--- dependent-name1.C (nonexistent)
+++ dependent-name1.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/10347: Dependent type checking of array new expression
+
+void bar (int *);
+
+template void foo() {
+ bar(new int[1]);
+}
dependent-name1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem20.C
===================================================================
--- ptrmem20.C (nonexistent)
+++ ptrmem20.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/43079
+
+struct A {};
+
+struct B
+{
+ void foo() const;
+ void foo();
+};
+
+template void bar();
+
+void baz()
+{
+ bar<&B::foo>(); // { dg-error "not a valid template argument|no match" }
+}
ptrmem20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash80.C
===================================================================
--- crash80.C (nonexistent)
+++ crash80.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/37087
+
+namespace a {
+ template class Foo;
+}
+
+namespace b {
+ template <> class ::a::Foo {}; // { dg-error "global qualification of class name is invalid" }
+}
crash80.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae13.C
===================================================================
--- sfinae13.C (nonexistent)
+++ sfinae13.C (revision 338)
@@ -0,0 +1,86 @@
+// DR 339
+//
+// Test of the use of casts with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#define CHECK_CAST(CastKind) \
+template \
+ typename enable_if<(sizeof((JOIN(CastKind,_cast)(create_a())), 0) > 0), \
+ yes_type>::type \
+ JOIN(check_,JOIN(CastKind,_cast))(int); \
+ \
+template \
+ no_type JOIN(check_,JOIN(CastKind,_cast))(...); \
+ \
+template \
+struct JOIN(has_,JOIN(CastKind,_cast)) \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,JOIN(CastKind,_cast))(0)) == sizeof(yes_type)); \
+}
+
+template
+typename enable_if<(sizeof(((U)create_a()), 0) > 0), yes_type>::type
+ check_c_cast(int);
+
+template no_type check_c_cast(...);
+
+template
+struct has_c_cast
+{
+ static const bool value =
+ (sizeof(check_c_cast(0)) == sizeof(yes_type));
+};
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+CHECK_CAST(static);
+CHECK_CAST(dynamic);
+CHECK_CAST(const);
+CHECK_CAST(reinterpret);
+
+struct X { virtual void f(); };
+struct Y { operator bool(); };
+struct Z : public X { };
+
+STATIC_ASSERT((has_static_cast::value));
+STATIC_ASSERT((!has_static_cast::value));
+STATIC_ASSERT((has_static_cast::value));
+
+STATIC_ASSERT(!(has_dynamic_cast::value));
+STATIC_ASSERT(!(has_dynamic_cast::value));
+STATIC_ASSERT(!(has_dynamic_cast::value));
+STATIC_ASSERT(!(has_dynamic_cast::value));
+STATIC_ASSERT((has_dynamic_cast::value));
+STATIC_ASSERT((has_dynamic_cast::value));
+STATIC_ASSERT(!(has_dynamic_cast::value));
+
+STATIC_ASSERT(!(has_const_cast::value));
+STATIC_ASSERT((has_const_cast::value));
+STATIC_ASSERT((has_const_cast::value));
+STATIC_ASSERT(!(has_const_cast::value));
+
+STATIC_ASSERT((has_reinterpret_cast::value));
+STATIC_ASSERT(!(has_reinterpret_cast::value));
+STATIC_ASSERT(!(has_reinterpret_cast::value));
+
+STATIC_ASSERT((has_c_cast::value));
+STATIC_ASSERT(!(has_c_cast::value));
+STATIC_ASSERT(!(has_c_cast::value));
sfinae13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash63.C
===================================================================
--- crash63.C (nonexistent)
+++ crash63.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/29729
+
+template void foo(T)
+{
+ struct A
+ {
+ template struct B // { dg-error "local class" }
+ {
+ typedef B<0> C;
+ }
+ };
+}
crash63.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access17.C
===================================================================
--- access17.C (nonexistent)
+++ access17.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/27339
+
+class A
+{
+private:
+ enum private_enum {a};
+
+ template // OK
+ struct B
+ {
+ void bm();
+ };
+public:
+ void am()
+ {
+ B instance; //OK
+ instance.bm();
+ }
+};
+
+template // FAIL
+void
+A::B::bm(){}
access17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lvalue1.C
===================================================================
--- lvalue1.C (nonexistent)
+++ lvalue1.C (revision 338)
@@ -0,0 +1,31 @@
+// PR c++/38877
+
+template
+struct pair
+{
+ typedef _T1 first_type;
+ typedef _T2 second_type;
+ _T1 first;
+ _T2 second;
+ pair () : first(), second() { }
+ pair(const _T1& __a, const _T2& __b)
+ : first(__a), second(__b) { }
+};
+
+template
+inline pair<_T1, _T2>
+make_pair(_T1 __x, _T2 __y)
+{
+ return pair<_T1, _T2>(__x, __y);
+}
+
+template class bar;
+
+template
+pair *, unsigned int>
+foo (unsigned int position)
+{
+ const pair tmp;
+ return make_pair (new bar(tmp.first),
+ position);
+ }
lvalue1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static3.C
===================================================================
--- static3.C (nonexistent)
+++ static3.C (revision 338)
@@ -0,0 +1,25 @@
+template class foo
+{
+ public:
+ static const int a;
+ static const int b;
+ static const int c;
+ static const int d;
+};
+
+template const int foo::a = 1;
+template const int foo::b = a;
+template const int foo::c = b;
+template const int foo::d = c;
+
+typedef foo fooInt;
+
+int main( void )
+{
+ fooInt *f;
+
+ f = new fooInt();
+
+ if (f->c != 1 || f->d != 1)
+ return 1;
+}
static3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash46.C
===================================================================
--- crash46.C (nonexistent)
+++ crash46.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/27102
+
+template
+void T::foo() {} // { dg-error "invalid" }
+
crash46.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename9.C
===================================================================
--- typename9.C (nonexistent)
+++ typename9.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Dec 2004
+
+// PR 18981. ICE
+// Origin: Andreas Schwab
+
+template
+struct tree {
+ struct iterator;
+ struct sibling_iterator {
+ friend struct tree::iterator;
+ };
+};
typename9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash29.C
===================================================================
--- crash29.C (nonexistent)
+++ crash29.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/18512
+
+template struct A {};
+
+struct B : A<0>
+{
+ void foo() { this->A<0>; } // { dg-error "" }
+};
crash29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new6.C
===================================================================
--- new6.C (nonexistent)
+++ new6.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/27713
+// { dg-do compile }
+
+struct A
+{
+ template friend void* operator new(__SIZE_TYPE__); // { dg-error "invalid template" }
+};
new6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend37.C
===================================================================
--- friend37.C (nonexistent)
+++ friend37.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/22147
+
+template struct A;
+
+template void foo(A* p) { *p; }
+
+template struct A
+{
+ friend void foo(A*);
+};
+
+void bar()
+{
+ foo(0);
+}
friend37.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator9.C
===================================================================
--- operator9.C (nonexistent)
+++ operator9.C (revision 338)
@@ -0,0 +1,9 @@
+//PR c++/27670
+
+template void foo(); // { dg-error "before|non-function|template" }
+
+void bar()
+{
+ foo(); // { dg-error "no matching function" }
+}
+
operator9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init6.C
===================================================================
--- init6.C (nonexistent)
+++ init6.C (revision 338)
@@ -0,0 +1,31 @@
+// PR c++/25836
+
+template
+class Iter {};
+
+template
+class SubIter : public Iter {
+ void insert(T);
+};
+
+class GraphBase {
+public:
+ class Node;
+};
+
+template
+class Graph : public GraphBase {
+ class Inner {
+ Iter::Node*> *get();
+ };
+};
+
+template
+Iter::Node*> *Graph::Inner::get() {
+ SubIter::Node*> *iter;
+ iter->insert(0);
+}
+
+int main() {
+ Iter::Node*> *n2_iter = new SubIter::Node*>();
+}
init6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static15.C
===================================================================
--- static15.C (nonexistent)
+++ static15.C (revision 338)
@@ -0,0 +1,71 @@
+// PR c++/23667
+// { dg-options "-std=gnu++98" }
+
+template
+ struct X
+ {
+ static const int n_primes = 256;
+ static const unsigned long primes[n_primes + 1];
+ };
+
+template
+ const int X::n_primes;
+
+template
+ const unsigned long X::primes[n_primes + 1] =
+ {
+ 2ul, 3ul, 5ul, 7ul, 11ul, 13ul, 17ul, 19ul, 23ul, 29ul, 31ul,
+ 37ul, 41ul, 43ul, 47ul, 53ul, 59ul, 61ul, 67ul, 71ul, 73ul, 79ul,
+ 83ul, 89ul, 97ul, 103ul, 109ul, 113ul, 127ul, 137ul, 139ul, 149ul,
+ 157ul, 167ul, 179ul, 193ul, 199ul, 211ul, 227ul, 241ul, 257ul,
+ 277ul, 293ul, 313ul, 337ul, 359ul, 383ul, 409ul, 439ul, 467ul,
+ 503ul, 541ul, 577ul, 619ul, 661ul, 709ul, 761ul, 823ul, 887ul,
+ 953ul, 1031ul, 1109ul, 1193ul, 1289ul, 1381ul, 1493ul, 1613ul,
+ 1741ul, 1879ul, 2029ul, 2179ul, 2357ul, 2549ul, 2753ul, 2971ul,
+ 3209ul, 3469ul, 3739ul, 4027ul, 4349ul, 4703ul, 5087ul, 5503ul,
+ 5953ul, 6427ul, 6949ul, 7517ul, 8123ul, 8783ul, 9497ul, 10273ul,
+ 11113ul, 12011ul, 12983ul, 14033ul, 15173ul, 16411ul, 17749ul,
+ 19183ul, 20753ul, 22447ul, 24281ul, 26267ul, 28411ul, 30727ul,
+ 33223ul, 35933ul, 38873ul, 42043ul, 45481ul, 49201ul, 53201ul,
+ 57557ul, 62233ul, 67307ul, 72817ul, 78779ul, 85229ul, 92203ul,
+ 99733ul, 107897ul, 116731ul, 126271ul, 136607ul, 147793ul,
+ 159871ul, 172933ul, 187091ul, 202409ul, 218971ul, 236897ul,
+ 256279ul, 277261ul, 299951ul, 324503ul, 351061ul, 379787ul,
+ 410857ul, 444487ul, 480881ul, 520241ul, 562841ul, 608903ul,
+ 658753ul, 712697ul, 771049ul, 834181ul, 902483ul, 976369ul,
+ 1056323ul, 1142821ul, 1236397ul, 1337629ul, 1447153ul, 1565659ul,
+ 1693859ul, 1832561ul, 1982627ul, 2144977ul, 2320627ul, 2510653ul,
+ 2716249ul, 2938679ul, 3179303ul, 3439651ul, 3721303ul, 4026031ul,
+ 4355707ul, 4712381ul, 5098259ul, 5515729ul, 5967347ul, 6456007ul,
+ 6984629ul, 7556579ul, 8175383ul, 8844859ul, 9569143ul, 10352717ul,
+ 11200489ul, 12117689ul, 13109983ul, 14183539ul, 15345007ul,
+ 16601593ul, 17961079ul, 19431899ul, 21023161ul, 22744717ul,
+ 24607243ul, 26622317ul, 28802401ul, 31160981ul, 33712729ul,
+ 36473443ul, 39460231ul, 42691603ul, 46187573ul, 49969847ul,
+ 54061849ul, 58488943ul, 63278561ul, 68460391ul, 74066549ul,
+ 80131819ul, 86693767ul, 93793069ul, 101473717ul, 109783337ul,
+ 118773397ul, 128499677ul, 139022417ul, 150406843ul, 162723577ul,
+ 176048909ul, 190465427ul, 206062531ul, 222936881ul, 241193053ul,
+ 260944219ul, 282312799ul, 305431229ul, 330442829ul, 357502601ul,
+ 386778277ul, 418451333ul, 452718089ul, 489790921ul, 529899637ul,
+ 573292817ul, 620239453ul, 671030513ul, 725980837ul, 785430967ul,
+ 849749479ul, 919334987ul, 994618837ul, 1076067617ul, 1164186217ul,
+ 1259520799ul, 1362662261ul, 1474249943ul, 1594975441ul,
+ 1725587117ul, 1866894511ul, 2019773507ul, 2185171673ul,
+ 2364114217ul, 2557710269ul, 2767159799ul, 2993761039ul,
+ 3238918481ul, 3504151727ul, 3791104843ul, 4101556399ul,
+ 4294967291ul,
+ 4294967291ul // sentinel so we don't have to test result of
+ // lower_bound
+ };
+
+template
+ struct static_assert;
+
+template<>
+ struct static_assert { };
+
+int main()
+{
+ static_assert< X<0>::n_primes == 256 >();
+}
static15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype10.C
===================================================================
--- nontype10.C (nonexistent)
+++ nontype10.C (revision 338)
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// Contributed by: Giovanni Bajo
+#include
+
+template struct A {};
+template struct B {};
+
+A a;
+B b; // { dg-error "" }
+
nontype10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg5.C
===================================================================
--- arg5.C (nonexistent)
+++ arg5.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/30534
+// { dg-do compile }
+
+template struct A;
+
+template void foo()
+{
+ A<__builtin_constant_p(.)> a; // { dg-error "template argument" }
+}
arg5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error41.C
===================================================================
--- error41.C (nonexistent)
+++ error41.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/40370
+// { dg-do compile }
+
+struct A
+{
+ static int i;
+};
+
+template struct B
+{
+ int x[A::i]; // { dg-error "array bound is not an integer constant" }
+};
error41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig2.C
===================================================================
--- koenig2.C (nonexistent)
+++ koenig2.C (revision 338)
@@ -0,0 +1,25 @@
+namespace nsp_foo {
+
+ struct A {};
+
+ struct foo {};
+
+}
+
+namespace nsp_bar {
+
+ void foo(nsp_foo::A) {}
+
+ template
+ void bar(T t)
+ {
+ nsp_bar::foo(t); // line 16
+ }
+
+}
+
+int main()
+{
+ nsp_bar::bar(nsp_foo::A());
+}
+
koenig2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec32.C
===================================================================
--- spec32.C (nonexistent)
+++ spec32.C (revision 338)
@@ -0,0 +1,6 @@
+//PR c++/28861
+
+struct A
+{
+ template class B> struct B<0>; // { dg-error "name of class shadows" }
+};
spec32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error24.C
===================================================================
--- error24.C (nonexistent)
+++ error24.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/30863
+
+template
+struct s {};
+
+void f() {
+ unsigned s x; // { dg-error "invalid" }
+}
error24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec15.C
===================================================================
--- spec15.C (nonexistent)
+++ spec15.C (revision 338)
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// Contributed by Wolfgang Bangerth
+// PR c++/509: Make sure specializations of member templates match correctly
+// between template and non-template overloads.
+
+template
+struct A {
+ template void f (U);
+ void f2 (int);
+
+ template void h (U);
+ void h (long);
+};
+
+template <>
+struct A {
+ template void g (U);
+ void g2 (float);
+};
+
+template <> void A::f (int); // { dg-error "" }
+// { dg-message "need 2" "" { target *-*-* } 21 }
+template <> template <> void A::f (int);
+
+template <> void A::f2 (int);
+template <> template <> void A::f2 (int); // { dg-error "" }
+
+template <> void A::g (float);
+template <> template <> void A::g(float); // { dg-error "" }
+
+template <> void A::g2 (float); // { dg-error "" }
+template <> template <> void A::g2(float); // { dg-error "" }
+
+template <> void A::h (long);
+template <> template <> void A::h(long);
spec15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp15.C
===================================================================
--- qualttp15.C (nonexistent)
+++ qualttp15.C (revision 338)
@@ -0,0 +1,33 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> struct X
+{
+ TT y;
+};
+
+template struct X
+{ // { dg-error "previous" }
+ T z;
+};
+
+template struct X // { dg-error "redefinition" }
+{
+ T z;
+};
+
+template struct C
+{
+ X x;
+};
+
+int main()
+{
+ C c;
+}
qualttp15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: type2.C
===================================================================
--- type2.C (nonexistent)
+++ type2.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// Origin: Juan Carlos Arevalo-Baeza
+
+// PR c++/8442
+// Type template parameter incorrectly treated as template template
+// parameter.
+
+template struct A {};
+
+template struct B
+{
+ template struct C {};
+ template A > foo(U);
+};
+
+B b;
type2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem12.C
===================================================================
--- ptrmem12.C (nonexistent)
+++ ptrmem12.C (revision 338)
@@ -0,0 +1,29 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Mar 2005
+
+// PR 20465
+// Origin: Matthias Klose
+// Andrew Pinski
+
+template
+void mem_fun_ref(_Ret (_Tp::*__f)());
+
+struct A {
+ double f();
+};
+
+void h ()
+{
+ mem_fun_ref(&A::f);
+}
+
+template
+void f()
+{
+ mem_fun_ref(&A::f);
+}
+
+void g()
+{
+ f();
+}
ptrmem12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond4.C
===================================================================
--- cond4.C (nonexistent)
+++ cond4.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/14369
+
+struct A { };
+
+template
+struct X : A {
+ const A* bar() const
+ { return this; }
+
+ const A& foo() const;
+};
+
+template
+const A& X::foo() const
+{
+ const A* t = bar();
+ return *(t ? t : throw 0);
+}
+
+
cond4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using3.C
===================================================================
--- using3.C (nonexistent)
+++ using3.C (revision 338)
@@ -0,0 +1,42 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003
+
+// PR 9447. Using decls in template classes.
+
+template
+struct Foo {
+ int i (int) {return 1;}
+};
+
+struct Baz
+{
+ int k (int) {return 2;}
+};
+
+template
+struct Bar : public Foo , Baz {
+ using Foo::i;
+ using Baz::k;
+
+ int i (float) {return 3;}
+ int k (float) {return 3;}
+
+ int foo()
+ {
+ if (i (1) != 1)
+ return 1;
+ if (k (1) != 2)
+ return 2;
+
+ return 0;
+ }
+};
+
+int main()
+{
+ Bar bar;
+
+ return bar.foo();
+}
using3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash72.C
===================================================================
--- crash72.C (nonexistent)
+++ crash72.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/29225
+// { dg-do compile }
+
+template bool operator< (L x, R y);
+struct T { int t (); };
+class S {};
+
+struct U
+{
+ typedef int (T::* M) ();
+ M m;
+
+ bool operator() (S &x)
+ {
+ T a;
+ return (a.*m) < x; // { dg-error "invalid use of non-static member" }
+ }
+};
+
+void foo (S &x)
+{
+ U m;
+ m.m = &T::t;
+ m (x);
+}
crash72.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash55.C
===================================================================
--- crash55.C (nonexistent)
+++ crash55.C (revision 338)
@@ -0,0 +1,6 @@
+//PR c++/27668
+
+template // { dg-error "nested-name-specifier|two or more|valid type" }
+struct A {};
+
+template void foo(A); // { dg-error "mismatch|constant|template argument" }
crash55.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef29.C
===================================================================
--- typedef29.C (nonexistent)
+++ typedef29.C (revision 338)
@@ -0,0 +1,25 @@
+// Origin: PR c++/42820
+// { dg-do compile }
+
+template struct vector{};
+templatestruct Traits{struct Primitive{struct Id{};};};
+
+template class Tree, class Polyhedron> struct Tree_vs_naive
+{
+ typedef typename Tree::Primitive Primitive;
+
+ void f() const
+ {
+ typedef vector Id_vector;
+ }
+};
+
+template class Tree> void test_hint_strategies()
+{
+ vector::Primitive::Id> v;
+}
+
+int main(void)
+{
+ test_hint_strategies();
+}
typedef29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: deduce2.C
===================================================================
--- deduce2.C (nonexistent)
+++ deduce2.C (revision 338)
@@ -0,0 +1,30 @@
+template struct tuple {
+ typedef tuple tail;
+};
+
+template <> struct tuple {
+};
+
+template
+struct length {
+ static const int i = length::tail>::i;
+};
+
+template<>
+struct length > {
+ static const int i = 1;
+};
+
+template struct M {};
+
+template
+M >::i > foo (A*);
+
+template
+M >::i> foo (const A*);
+
+const int i1 = 3;
+
+void bar() {
+ foo (&i1);
+}
deduce2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash38.C
===================================================================
--- crash38.C (nonexistent)
+++ crash38.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/23307
+
+class A
+{
+ template
+ static void f(X&); // { dg-error "" }
+ inline void A::f(X&); // { dg-error "f|expected" }
+};
crash38.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init-list.C
===================================================================
--- init-list.C (nonexistent)
+++ init-list.C (revision 338)
@@ -0,0 +1,17 @@
+// Contributed by Gabriel Dos Reis
+// { dg-do compile }
+
+template
+struct Base {
+ Base(int) { }
+};
+
+template
+struct Derived : Base {
+ Derived();
+};
+
+template
+Derived::Derived() : Base(4) { } // { dg-error "have any field" "" }
+
+
init-list.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype1.C
===================================================================
--- nontype1.C (nonexistent)
+++ nontype1.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/4934
+// dump_expr didn't know how to deal with a CONVERT_EXPR with no type.
+
+template struct A {};
+template struct B { A a; };
nontype1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: eh2.C
===================================================================
--- eh2.C (nonexistent)
+++ eh2.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/23191
+// Origin: Volker Reichelt
+// { dg-do compile }
+
+template struct A
+{
+ void foo() throw(typename T::X); // { dg-error "not a class" }
+};
+
+A a; // { dg-message "instantiated" }
eh2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error5.C
===================================================================
--- error5.C (nonexistent)
+++ error5.C (revision 338)
@@ -0,0 +1,6 @@
+template
+struct X { // { dg-error "not a template" }
+ typedef int Y;
+};
+
+extern struct Z s; // { dg-error "not a template" }
error5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec5.C
===================================================================
--- spec5.C (nonexistent)
+++ spec5.C (revision 338)
@@ -0,0 +1,3 @@
+template struct A;
+template <> struct A<0> { struct B; };
+struct A<0>::B {};
spec5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp5.C
===================================================================
--- qualttp5.C (nonexistent)
+++ qualttp5.C (revision 338)
@@ -0,0 +1,25 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template struct A
+{
+ template class B {}; // { dg-message "candidate is" }
+};
+
+template class TT> void f()
+{
+ TT y;
+ y = 0; // { dg-error "no match" }
+}
+
+template struct C
+{
+ void g() { f::template B>(); } // { dg-message "instantiated" }
+};
+
+int main()
+{
+ C c;
+ c.g(); // { dg-message "instantiated" }
+}
qualttp5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify7.C
===================================================================
--- unify7.C (nonexistent)
+++ unify7.C (revision 338)
@@ -0,0 +1,14 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Apr 2004
+
+// PR c++/3518
+template void Foo (const T &);
+template void Baz (const T (*)());
+
+int &f ();
+
+int main()
+{
+ Foo (f);
+ Baz (f); // { dg-error "no matching function" "" }
+}
unify7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend46.C
===================================================================
--- friend46.C (nonexistent)
+++ friend46.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/27714
+
+template struct A
+{
+ static void* operator new(__SIZE_TYPE__);
+ template friend void* A::operator new(__SIZE_TYPE__);
+};
+
+A a;
friend46.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend29.C
===================================================================
--- friend29.C (nonexistent)
+++ friend29.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/15701
+
+template class T> struct A : T<0>
+{
+ void foo();
+ template class U> friend void A::foo();
+};
+
+template struct B {};
+
+A a;
friend29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof4.C
===================================================================
--- sizeof4.C (nonexistent)
+++ sizeof4.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin:
+// c++/4933: using sizeof with comma operator as template argument
+
+template
+struct Foo {};
+
+template
+T makeT();
+
+template
+struct Bar
+{
+ typedef Foo
+ <
+ sizeof((makeT(), makeT()))
+ > Type;
+};
sizeof4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void5.C
===================================================================
--- void5.C (nonexistent)
+++ void5.C (revision 338)
@@ -0,0 +1,5 @@
+//PR c++/28640
+
+template struct A; // { dg-error "not a valid type" }
+template struct A;
+
void5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend1.C
===================================================================
--- memfriend1.C (nonexistent)
+++ memfriend1.C (revision 338)
@@ -0,0 +1,54 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function of class template as friend
+
+template struct A
+{
+ void f();
+};
+
+class C {
+ int i;
+ template friend void A::f();
+};
+
+template struct A
+{
+ void f();
+};
+
+template<> struct A
+{
+ void f();
+};
+
+template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A a1;
+ a1.f();
+ A a2;
+ a2.f();
+ A a3;
+ a3.f();
+}
memfriend1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof-template-argument.C
===================================================================
--- sizeof-template-argument.C (nonexistent)
+++ sizeof-template-argument.C (revision 338)
@@ -0,0 +1,15 @@
+/* This used to ICE (PR c++/29573) */
+/* { dg-do "compile" } */
+
+template struct A {};
+
+template struct B : A {}; /* { dg-error "parse error in template argument list" } */
+
+template struct C : A {}; /* { dg-error "parse error in template argument list" } */
+
+int a;
+
+template struct D : A {}; /* This used to ICE as well. */
+
+template struct E : A {}; /* This used to ICE as well. */
+
sizeof-template-argument.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum5.C
===================================================================
--- enum5.C (nonexistent)
+++ enum5.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: robertk@mathematik.uni-freiburg.de
+// Wolfgang Bangerth
+
+// PR c++/14479: Template header check for enum
+
+template
+struct X {
+ enum { dimension = dim };
+ template void bar ();
+};
+
+template <>
+template <>
+void X<0>::bar<0> () {}
enum5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp4.C
===================================================================
--- ttp4.C (nonexistent)
+++ ttp4.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// Origin: Ewgenij Gawrilow
+
+// PR c++/6723
+// ICE when default template argument contains instantiation of
+// template template parameter.
+
+template class Predicate,
+ bool _matches=Predicate::answer>
+struct helper { };
ttp4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem7.C
===================================================================
--- ptrmem7.C (nonexistent)
+++ ptrmem7.C (revision 338)
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// Origin:
+// c++/2094: unsupported 'ptrmem_cst' in type unification
+
+struct R
+{
+ int i;
+};
+
+struct S
+{
+ int i;
+ int j;
+};
+
+struct S2 : S
+{};
+
+template
+struct X
+{
+ X ();
+ template X(const X
&); +}; + +X<&S::i,S> x = X<&S::i,S>(); +X<&S::i,S> x2 = X<&S2::i,S>(); +X<&S::i,S> y = X<&S::j,S>(); // { dg-error "" } +X<&S::i,S> z = X<&R::i,S>(); // { dg-error "" }
ptrmem7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup2.C
===================================================================
--- lookup2.C (nonexistent)
+++ lookup2.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Mar 2003
+
+// PR 11617: Failed to diagnose missing function.
+
+struct B {};
+
+template void Bar ()
+{
+ T::foo (); // { dg-error "is not a member of" "" }
+}
+
+void Foo ()
+{
+ Bar (); // { dg-message "instantiated" "" }
+}
lookup2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static24.C
===================================================================
--- static24.C (nonexistent)
+++ static24.C (revision 338)
@@ -0,0 +1,15 @@
+template struct A;
+
+template<> struct A
+{
+ static const char i = 1;
+};
+
+template struct B
+{
+ static const int j = A::i;
+ static const int k = int(j);
+ int x[k];
+};
+
+B b;
static24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae9.C
===================================================================
--- sfinae9.C (nonexistent)
+++ sfinae9.C (revision 338)
@@ -0,0 +1,207 @@
+// DR 339
+//
+// Test of the use of various assignment operators with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#define DEFINE_INFIX_BINARY_TRAIT(Name,Op) \
+template \
+ typename enable_if<(sizeof(create_a() Op create_a(), 1) > 0), \
+ yes_type>::type \
+ JOIN(check_,Name)(type, type); \
+ \
+no_type JOIN(check_,Name)(...); \
+ \
+template \
+struct Name \
+{ \
+ static const bool value = \
+ (sizeof(JOIN(check_,Name)(type(), type())) == sizeof(yes_type)); \
+}
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct Y {
+ Y& operator=(Y&);
+};
+
+struct X {
+ X& operator=(Y);
+ X& operator+=(X);
+ X& operator-=(X);
+ X& operator*=(X);
+ X& operator/=(X);
+ X& operator%=(X);
+ X& operator^=(X);
+ X& operator&=(X);
+ X& operator|=(X);
+ X& operator<<=(X);
+ X& operator>>=(X);
+};
+struct Z { };
+
+// is_assignable
+DEFINE_INFIX_BINARY_TRAIT(is_assignable, =);
+STATIC_ASSERT((is_assignable::value));
+STATIC_ASSERT((is_assignable::value));
+STATIC_ASSERT((is_assignable::value));
+STATIC_ASSERT((!is_assignable::value));
+STATIC_ASSERT((is_assignable::value));
+STATIC_ASSERT((is_assignable::value));
+STATIC_ASSERT((!is_assignable::value));
+STATIC_ASSERT((!is_assignable::value));
+STATIC_ASSERT((!is_assignable::value));
+
+// has_plus_assign
+DEFINE_INFIX_BINARY_TRAIT(has_plus_assign, +=);
+X& operator+=(X&, Y);
+STATIC_ASSERT((has_plus_assign::value));
+STATIC_ASSERT((has_plus_assign::value));
+STATIC_ASSERT((has_plus_assign::value));
+STATIC_ASSERT((has_plus_assign::value));
+STATIC_ASSERT((!has_plus_assign::value));
+STATIC_ASSERT((has_plus_assign::value));
+STATIC_ASSERT((!has_plus_assign::value));
+STATIC_ASSERT((!has_plus_assign::value));
+STATIC_ASSERT((!has_plus_assign::value));
+
+// has_minus_assign
+DEFINE_INFIX_BINARY_TRAIT(has_minus_assign, -=);
+X& operator-=(X&, Y);
+STATIC_ASSERT((has_minus_assign::value));
+STATIC_ASSERT((has_minus_assign::value));
+STATIC_ASSERT((has_minus_assign::value));
+STATIC_ASSERT((has_minus_assign::value));
+STATIC_ASSERT((!has_minus_assign::value));
+STATIC_ASSERT((has_minus_assign::value));
+STATIC_ASSERT((!has_minus_assign::value));
+STATIC_ASSERT((!has_minus_assign::value));
+STATIC_ASSERT((!has_minus_assign::value));
+STATIC_ASSERT((!has_minus_assign::value));
+
+// has_multiply_assign
+DEFINE_INFIX_BINARY_TRAIT(has_multiply_assign, *=);
+X& operator*=(X&, Y);
+STATIC_ASSERT((has_multiply_assign::value));
+STATIC_ASSERT((has_multiply_assign::value));
+STATIC_ASSERT((has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+STATIC_ASSERT((has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+STATIC_ASSERT((!has_multiply_assign::value));
+
+// has_divide_assign
+DEFINE_INFIX_BINARY_TRAIT(has_divide_assign, /=);
+X& operator/=(X&, Y);
+STATIC_ASSERT((has_divide_assign::value));
+STATIC_ASSERT((has_divide_assign::value));
+STATIC_ASSERT((has_divide_assign::value));
+STATIC_ASSERT((!has_divide_assign::value));
+STATIC_ASSERT((!has_divide_assign::value));
+STATIC_ASSERT((has_divide_assign::value));
+STATIC_ASSERT((!has_divide_assign::value));
+STATIC_ASSERT((!has_divide_assign::value));
+STATIC_ASSERT((!has_divide_assign::value));
+
+// has_remainder_assign
+DEFINE_INFIX_BINARY_TRAIT(has_remainder_assign, %=);
+X& operator%=(X&, Y);
+STATIC_ASSERT((has_remainder_assign::value));
+STATIC_ASSERT((has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+STATIC_ASSERT((has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+STATIC_ASSERT((has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+STATIC_ASSERT((!has_remainder_assign::value));
+
+// has_xor_assign
+DEFINE_INFIX_BINARY_TRAIT(has_xor_assign, ^=);
+X& operator^=(X&, Y);
+STATIC_ASSERT((has_xor_assign::value));
+STATIC_ASSERT((has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+STATIC_ASSERT((has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+STATIC_ASSERT((has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+STATIC_ASSERT((!has_xor_assign::value));
+
+// has_bitand_assign
+DEFINE_INFIX_BINARY_TRAIT(has_bitand_assign, &=);
+X& operator&=(X&, Y);
+STATIC_ASSERT((has_bitand_assign::value));
+STATIC_ASSERT((has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+STATIC_ASSERT((has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+STATIC_ASSERT((has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+STATIC_ASSERT((!has_bitand_assign::value));
+
+// has_bitor_assign
+DEFINE_INFIX_BINARY_TRAIT(has_bitor_assign, |=);
+X& operator|=(X&, Y);
+STATIC_ASSERT((has_bitor_assign::value));
+STATIC_ASSERT((has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+STATIC_ASSERT((has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+STATIC_ASSERT((has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+STATIC_ASSERT((!has_bitor_assign::value));
+
+// has_left_shift_assign
+DEFINE_INFIX_BINARY_TRAIT(has_left_shift_assign, <<=);
+X& operator<<=(X&, Y);
+STATIC_ASSERT((has_left_shift_assign::value));
+STATIC_ASSERT((has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+STATIC_ASSERT((has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+STATIC_ASSERT((has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+STATIC_ASSERT((!has_left_shift_assign::value));
+
+// has_right_shift_assign
+DEFINE_INFIX_BINARY_TRAIT(has_right_shift_assign, >>=);
+X& operator>>=(X&, Y);
+STATIC_ASSERT((has_right_shift_assign::value));
+STATIC_ASSERT((has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
+STATIC_ASSERT((has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
+STATIC_ASSERT((has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
+STATIC_ASSERT((!has_right_shift_assign::value));
sfinae9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv9.C
===================================================================
--- conv9.C (nonexistent)
+++ conv9.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/28557
+
+struct A
+{
+ template operator T() { return T(); }
+};
+
+template void foo()
+{
+ A().operator int();
+}
+
+void bar()
+{
+ foo<0>();
+}
conv9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error33.C
===================================================================
--- error33.C (nonexistent)
+++ error33.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/24791
+
+template struct A
+{
+ static int i;
+ A() { ++i; }
+};
+
+template int A<0>::i(0); // { dg-error "template" "error" }
+// { dg-message "note" "note" { target *-*-* } 9 }
+
+A<0> a;
error33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec24.C
===================================================================
--- spec24.C (nonexistent)
+++ spec24.C (revision 338)
@@ -0,0 +1,22 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 June 2005
+
+// PR 20350: ICE on member specialization with later initialization
+// Origin: Carlo Wood carlo@gcc.gnu.org
+
+template struct Mutex
+{
+ static int mutex;
+};
+
+template
+int Mutex::mutex = {1};
+
+template <> int Mutex<0>::mutex;
+template <> int Mutex<0>::mutex = 0;
+
+void g()
+{
+ Mutex<0>::mutex = 0;
+}
+
spec24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error16.C
===================================================================
--- error16.C (nonexistent)
+++ error16.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/18674
+
+template
+static void g() {
+ enum I::t a; // { dg-error "" }
+ (void) a;
+}
+
+struct B {
+ typedef int t;
+};
+
+void h()
+{
+ g();
+}
error16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof12.C
===================================================================
--- sizeof12.C (nonexistent)
+++ sizeof12.C (revision 338)
@@ -0,0 +1,19 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/41863
+
+template
+struct Bar
+{
+};
+
+template
+class Foo
+{
+ T m_foo;
+
+ void
+ crash()
+ {
+ Bar bar;
+ }
+};
sizeof12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array5.C
===================================================================
--- array5.C (nonexistent)
+++ array5.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/15427
+
+template
+struct A
+{
+ T foo;
+};
+
+template
+struct B
+{
+ A _squares[2];
+};
+
array5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void12.C
===================================================================
--- void12.C (nonexistent)
+++ void12.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/28639
+
+template struct A // { dg-error "not a valid type" }
+{
+ static const int i = 1;
+ char a[i];
+};
void12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name2.C
===================================================================
--- dependent-name2.C (nonexistent)
+++ dependent-name2.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Aug 2003
+
+// PR 10530. Thought a type was dependent.
+
+template
+struct Foo {
+ struct Inner {
+ typedef int type;
+ };
+};
+
+template struct Bar {
+ typedef typename Foo::Inner::type type;
+};
+
dependent-name2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem21.C
===================================================================
--- ptrmem21.C (nonexistent)
+++ ptrmem21.C (revision 338)
@@ -0,0 +1,37 @@
+// PR c++/43868
+// { dg-options "-g" }
+
+struct Foo
+{
+ virtual void do_something() = 0;
+};
+
+template
+struct Foo_impl;
+
+template
+struct Foo_impl : public Foo
+{
+ struct Helper
+ {
+ typedef int Some_type;
+ operator Some_type () const { return 0; }
+ Helper( R (O::*)() const) {}
+ };
+
+ void do_something() { Helper( 0); };
+};
+
+void register_foo_internal( Foo*) {};
+
+template
+void register_foo( TT) { register_foo_internal( new Foo_impl()); }
+
+struct Bar
+{
+};
+
+void setup()
+{
+ register_foo( (int (Bar::*) () const) 0);
+}
ptrmem21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash81.C
===================================================================
--- crash81.C (nonexistent)
+++ crash81.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/34485
+
+struct A
+{
+ template struct X; // { dg-error "'T' has not been declared" "T" }
+ // { dg-error "declaration of 'template struct A::X'" "A::X" { target *-*-* } 5 }
+ // { dg-error "shadows template parm 'int X'" "shadow" { target *-*-* } 5 }
+};
crash81.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae14.C
===================================================================
--- sfinae14.C (nonexistent)
+++ sfinae14.C (revision 338)
@@ -0,0 +1,79 @@
+// DR 339
+//
+// Test of the use of the new and new[] operators with SFINAE
+
+// Boilerplate helpers
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+template
+typename enable_if<(sizeof(new T, 0) > 0), yes_type>::type
+ check_new(int);
+
+template no_type check_new(...);
+
+template
+struct has_new
+{
+ static const bool value =
+ (sizeof(check_new(0)) == sizeof(yes_type));
+};
+
+template
+typename enable_if<(sizeof((new T(create_a())), 0) > 0),
+ yes_type>::type
+ check_new_one_arg(int);
+
+template no_type check_new_one_arg(...);
+
+template
+struct has_new_one_arg
+{
+ static const bool value =
+ (sizeof(check_new_one_arg(0)) == sizeof(yes_type));
+};
+
+template
+typename enable_if<(sizeof(new T[N], 0) > 0), yes_type>::type
+ check_array_new(int);
+
+template no_type check_array_new(...);
+
+template
+struct has_array_new
+{
+ static const bool value =
+ (sizeof(check_array_new(0)) == sizeof(yes_type));
+};
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+struct X {
+ X(int);
+};
+
+struct Y { int foo; };
+
+STATIC_ASSERT((has_new::value));
+STATIC_ASSERT(!(has_new::value));
+STATIC_ASSERT((has_new_one_arg::value));
+STATIC_ASSERT((has_new_one_arg::value));
+STATIC_ASSERT(!(has_new_one_arg::value));
+
+STATIC_ASSERT((has_array_new::value));
+STATIC_ASSERT(!(has_array_new::value));
+STATIC_ASSERT((has_array_new::value));
sfinae14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash64.C
===================================================================
--- crash64.C (nonexistent)
+++ crash64.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/29730
+
+struct A
+{
+ template void foo()(0); // { dg-error "initializer" }
+};
crash64.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access18.C
===================================================================
--- access18.C (nonexistent)
+++ access18.C (revision 338)
@@ -0,0 +1,19 @@
+// DR 401
+
+class X {
+ typedef int a; // { dg-error "private" }
+ static const int b = 5; // { dg-error "private" }
+ template
+ struct c; // { dg-error "private" }
+};
+
+template // { dg-error "context" }
+struct A;
+
+template // { dg-error "context" }
+struct B;
+
+template class T = X::c> // { dg-error "context" }
+struct C;
+
+
access18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static4.C
===================================================================
--- static4.C (nonexistent)
+++ static4.C (revision 338)
@@ -0,0 +1,7 @@
+template
+struct A {
+ static int _test; // { dg-error "" }
+ static int _test; // { dg-error "" }
+};
+template int A::_test = 0;
+struct B : public A { };
static4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash47.C
===================================================================
--- crash47.C (nonexistent)
+++ crash47.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/27102
+
+template void T::X::foo() {} // { dg-error "invalid|not a type" }
crash47.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local1.C
===================================================================
--- local1.C (nonexistent)
+++ local1.C (revision 338)
@@ -0,0 +1,25 @@
+// PR c++/4286: We were crashing when trying to set up the class bindings in
+// g(), because xref wanted the mangled name, which breaks inside a template.
+
+// Of course, the offending code is actually ill-formed anyway, so check
+// for the error. Also check that it's formatted properly.
+
+struct A
+{
+ template void f();
+};
+
+template void A::f()
+{
+ struct B
+ {
+ void g() {}
+ static int x; // { dg-error "static.*int A::f\\(\\)::B::x" "" }
+ };
+}
+
+int main ()
+{
+ A a;
+ a.f ();
+}
local1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new7.C
===================================================================
--- new7.C (nonexistent)
+++ new7.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/27714
+
+template struct A
+{
+ static void* operator new(__SIZE_TYPE__);
+ template friend void* A::operator new(__SIZE_TYPE__);
+};
+
+A a;
new7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend38.C
===================================================================
--- friend38.C (nonexistent)
+++ friend38.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/22352
+
+template
+class s
+{
+ typedef int d;
+ template
+ friend class t;
+};
+
+s t1;
+
friend38.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor1.C
===================================================================
--- ctor1.C (nonexistent)
+++ ctor1.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Dec 2001
+
+// PR 5132. ICE on struct constructors in templates.
+
+// snippets from bits/huge_val.h
+
+#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+#define __huge_val_t union { unsigned char __c[8]; double __d; }
+#define HUGE_VAL (__extension__ \
+ ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
+
+void foo( const int&) {
+ HUGE_VAL; // no problem here
+}
+
+template
+void Tfoo( const F&) {
+ HUGE_VAL; // g++ fails here
+}
+
+template struct M { T m; };
+
+void Foo ()
+{
+ Tfoo (1.2f);
+ (__extension__ ((M) {m:3}));
+ (__extension__ ((M []) {{m:3}}));
+}
ctor1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init7.C
===================================================================
--- init7.C (nonexistent)
+++ init7.C (revision 338)
@@ -0,0 +1,9 @@
+/* PR c++/31517. This used to ICE. */
+/* { dg-do "compile" } */
+
+template struct A
+{
+ static const int i=0;
+};
+
+template const int A::i = 0=0; /* { dg-error "duplicate initialization" } */
init7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: copy1.C
===================================================================
--- copy1.C (nonexistent)
+++ copy1.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: hkluender@otg.com
+
+// PR 5189
+
+struct A
+{
+ A(A&); // { dg-message "candidate" }
+ template A(T);
+};
+
+A a = 0; // { dg-error "no matching function" }
+
copy1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static16.C
===================================================================
--- static16.C (nonexistent)
+++ static16.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/23691
+
+namespace std {
+ class type_info {
+ bool operator==(const type_info& __arg) const;
+ };
+}
+template struct integral_constant {
+ static const T value = val;
+};
+template< typename T > struct is_integral : integral_constant {};
+template struct enable_if_c {};
+template
+typename enable_if_c<(is_integral::value)>::type
+operator==(const int& f, Functor g);
+template
+int get_deleter( std::type_info const & ti )
+{
+ return ti == typeid(D);
+}
static16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype11.C
===================================================================
--- nontype11.C (nonexistent)
+++ nontype11.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// Origin:
+// PR c++/18354: Unary plus should not be wrapped in NON_LVALUE_EXPR
+
+template
+struct X { };
+
+const int n = 1;
+
+void f()
+{
+ X< 1> a;
+ X<-1> b;
+ X<+1> c;
+}
+
+void g()
+{
+ X< n> a;
+ X<-n> b;
+ X<+n> c;
+}
nontype11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg6.C
===================================================================
--- arg6.C (nonexistent)
+++ arg6.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/33744
+// { dg-do run }
+
+template struct A { bool b; A() : b(B) {}; };
+A a;
+A b;
+A<(bool)(2>1)> c;
+A1))> d;
+A1)> e;
+
+int
+main ()
+{
+ return (a.b && b.b && c.b && d.b && e.b) ? 0 : 1;
+}
arg6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error42.C
===================================================================
--- error42.C (nonexistent)
+++ error42.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/40372
+// { dg-do compile }
+
+template struct A
+{
+ int i; // { dg-error "invalid use of non-static data member" }
+ friend void foo ()
+ {
+ int x[i]; // { dg-error "from this location" }
+ }
+};
+
+struct B
+{
+ int j; // { dg-error "invalid use of non-static data member" }
+ friend int bar ()
+ {
+ return j; // { dg-error "from this location" }
+ }
+};
error42.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig3.C
===================================================================
--- koenig3.C (nonexistent)
+++ koenig3.C (revision 338)
@@ -0,0 +1,28 @@
+// PR c++/13157
+
+namespace aa
+{
+ double abs(double);
+ long double abs(long double);
+}
+
+namespace fu
+{
+ template
+ struct X
+ {};
+
+ template
+ X test(X x)
+ {
+ using ::aa::abs;
+ return abs(x);
+ }
+
+ template
+ X abs(X);
+
+ X x;
+ X z = test(x);
+}
+
koenig3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec33.C
===================================================================
--- spec33.C (nonexistent)
+++ spec33.C (revision 338)
@@ -0,0 +1,7 @@
+//PR c++/27667
+
+struct A
+{
+ template static void foo () {}
+ template<> static void foo<0>() {} // { dg-error "explicit|template" }
+};
spec33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error25.C
===================================================================
--- error25.C (nonexistent)
+++ error25.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/31923
+
+template
+static void f1 ();
+
+template<>
+static void f1 (); // { dg-error "explicit template specialization cannot have a storage class" }
+
+template
+extern void f2 ();
+
+template<>
+extern void f2 (); // { dg-error "explicit template specialization cannot have a storage class" }
+
+export template // { dg-warning "keyword 'export' not implemented" }
+static void* f3 ();
error25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec16.C
===================================================================
--- spec16.C (nonexistent)
+++ spec16.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// Contributed by Giovanni Bajo
+// PR c++/14497: Reject specialization without template headers
+
+template
+struct A {
+ template void B () ;
+};
+
+void A<0>::B<0>() { // { dg-error "specializing member 'A<0>::B<0>' requires 'template<>' syntax" }
+}
spec16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp16.C
===================================================================
--- qualttp16.C (nonexistent)
+++ qualttp16.C (revision 338)
@@ -0,0 +1,40 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do run }
+
+extern "C" void abort();
+
+struct A
+{
+ template class B {};
+};
+
+template class TT, class T> struct X
+{
+ TT y;
+ T z;
+ int f() { return 0; }
+};
+
+template struct X
+{
+ typename T::template B y;
+ T z;
+ int f() { return 1; }
+};
+
+template struct C
+{
+ X x;
+};
+
+int main()
+{
+ C c;
+ X x1;
+ X x2;
+ if (x1.f() != 1)
+ abort();
+ if (x2.f() != 0)
+ abort();
+}
qualttp16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem13.C
===================================================================
--- ptrmem13.C (nonexistent)
+++ ptrmem13.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/20734
+
+struct A;
+void blah(int A::*);
+struct A{
+ int a;
+};
+template
+void hoho(){
+ blah(&A::a);
+}
ptrmem13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond5.C
===================================================================
--- cond5.C (nonexistent)
+++ cond5.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/18464
+
+struct A
+{
+ A(int);
+ operator void*() const;
+};
+
+template void foo(const A& x) { 0 ? x : (x ? x : 0); }
cond5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using4.C
===================================================================
--- using4.C (nonexistent)
+++ using4.C (revision 338)
@@ -0,0 +1,39 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003
+
+// PR 9447. Using decls in template classes.
+
+template
+struct Foo {
+ int k (float) {return 1;}
+};
+
+struct Baz
+{
+ int k (int) {return 2;}
+};
+
+template
+struct Bar : public Foo , Baz {
+ using Foo::k;
+ using Baz::k;
+
+ int foo()
+ {
+ if (k (1.0f) != 1)
+ return 1;
+ if (k (1) != 2)
+ return 2;
+
+ return 0;
+ }
+};
+
+int main()
+{
+ Bar bar;
+
+ return bar.foo();
+}
using4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash90.C
===================================================================
--- crash90.C (nonexistent)
+++ crash90.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/39750
+
+template < unsigned >
+struct A ;
+template < typename >
+struct B ;
+template < typename T , A < B < T > // { dg-error "initializer|parse error|valid type|expected" }
+{ }
crash90.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash73.C
===================================================================
--- crash73.C (nonexistent)
+++ crash73.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/34100
+// { dg-do compile }
+
+template struct A
+{
+ typedef typename T::X Y __attribute__((vector_size(8))); // { dg-error "is not a class, struct" }
+};
+
+A a;
crash73.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash56.C
===================================================================
--- crash56.C (nonexistent)
+++ crash56.C (revision 338)
@@ -0,0 +1,16 @@
+// Origin: Wolfgang Bangerth
+
+// PR c++/28705
+// DR 218 is debating whether this is well formed or not. We've never
+// accepted it (because we'd crash), so we continue to reject it, but
+// without crashing.
+
+namespace N
+{
+ struct A { A (A*); };
+}
+
+template void g (N::A *p)
+{
+ (void) A (p); // { dg-message "" "" }
+}
crash56.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: deduce3.C
===================================================================
--- deduce3.C (nonexistent)
+++ deduce3.C (revision 338)
@@ -0,0 +1,9 @@
+template
+void f(int, T (*)() = 0);
+
+void g() {
+ typedef int A[2];
+ f(0); // { dg-error "" }
+ typedef void F();
+ f(0); // { dg-error "" }
+}
deduce3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash39.C
===================================================================
--- crash39.C (nonexistent)
+++ crash39.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/22405
+
+template void foo(T &arg) { // { dg-error "declared" }
+ arg+=1;
+}
+
+template void foo(T &arg) { // { dg-error "redefinition" }
+ arg+=2;
+}
+
+template void foo(float &arg);
crash39.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype2.C
===================================================================
--- nontype2.C (nonexistent)
+++ nontype2.C (revision 338)
@@ -0,0 +1,11 @@
+template struct A {};
+
+template struct B
+{
+ void foo()
+ {
+ const int i=0;
+ typedef A< i<=1 > C;
+ typedef A< i<=2 > C;
+ }
+};
nontype2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error6.C
===================================================================
--- error6.C (nonexistent)
+++ error6.C (revision 338)
@@ -0,0 +1,13 @@
+template
+struct tento {
+ enum {value = 10*tento::value};
+};
+
+struct tento<0> { // { dg-error "" }
+ enum {value=1};
+};
+
+int main() {
+ if (tento<4>::value != 10000) return -1;
+}
+
error6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec6.C
===================================================================
--- spec6.C (nonexistent)
+++ spec6.C (revision 338)
@@ -0,0 +1,10 @@
+template struct X {};
+
+template struct X {
+ typedef double* type;
+ type foo () const;
+};
+
+template
+typename X::type
+X::foo () const {}
spec6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp6.C
===================================================================
--- qualttp6.C (nonexistent)
+++ qualttp6.C (revision 338)
@@ -0,0 +1,15 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template class TT> class C {
+};
+
+template struct D {
+ C c; // { dg-error "no class template" }
+};
+
+struct E {
+};
+
+D d; // { dg-message "instantiated" }
qualttp6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify8.C
===================================================================
--- unify8.C (nonexistent)
+++ unify8.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do link }
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jul 2005
+
+// Origin:Wolfgang Bangerth
+// PR 21799: deduction of cvqualifiers on member functions was wrong
+
+template void f (T &, void (T::*)() );
+template void f (const T &, void (T::*)() const) {}
+
+struct X {
+ void g() const {}
+};
+
+const X *x;
+
+int main () {
+ f (*x, &X::g);
+}
unify8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend47.C
===================================================================
--- friend47.C (nonexistent)
+++ friend47.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/19809
+
+template
+struct n{
+ friend void foo(){ } // { dg-error "defin" }
+};
+
+int main(){
+ n<1> n1;
+ n<2> n2;
+}
friend47.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: delete1.C
===================================================================
--- delete1.C (nonexistent)
+++ delete1.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/15890
+
+template < typename T >
+void operator delete ( void* raw ) { // { dg-error "" }
+ delete raw;
+}
+
+class A { };
+
+int main() {
+ A* a = new A;
+ delete a;
+}
+
delete1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof5.C
===================================================================
--- sizeof5.C (nonexistent)
+++ sizeof5.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/9907
+// Origin: nes@lrde.epita.fr
+// sizeof(foo()) was not considered constant.
+
+
+template struct bar {};
+
+int foo();
+
+template
+void baz()
+{
+ bar b;
+}
+
sizeof5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void6.C
===================================================================
--- void6.C (nonexistent)
+++ void6.C (revision 338)
@@ -0,0 +1,3 @@
+//PR c++/28594
+
+template struct A; // { dg-error "not a valid type" }
void6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend2.C
===================================================================
--- memfriend2.C (nonexistent)
+++ memfriend2.C (revision 338)
@@ -0,0 +1,61 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function template of class template as friend
+
+template struct A
+{
+ template void f();
+};
+
+class C {
+ int i;
+ template template friend void A::f();
+};
+
+template struct A
+{
+ template void f();
+};
+
+template <> struct A
+{
+ template void f();
+};
+
+template template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A a1;
+ a1.f();
+ A a2;
+ a2.f();
+ A a3;
+ a3.f();
+ a3.f();
+}
memfriend2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum6.C
===================================================================
--- enum6.C (nonexistent)
+++ enum6.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/34774
+
+template
+struct shift {
+ enum {
+ n0 = (unsigned)shifts,
+ n = n0 ? 0 : n0,
+ n_comp = -n
+ } x;
+};
enum6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp5.C
===================================================================
--- ttp5.C (nonexistent)
+++ ttp5.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: sneechy@hotmail.com
+
+// PR c++/8772: Incorrect diagnostics for template template parameter
+// mismatch
+
+template struct A {
+ template struct B {
+ enum { v = 1 };
+ };
+};
+
+template class F> struct C {
+ enum { v = F<1>::v || 2 };
+};
+
+template struct D {
+ enum { v = C::B>::v }; // { dg-error "mismatch|class template" }
+};
ttp5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem8.C
===================================================================
--- ptrmem8.C (nonexistent)
+++ ptrmem8.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// Origin:
+// PR c++/10126: Handle ptmf default conversions while matching a template
+// argument
+
+struct B
+{
+ int I () const;
+ int I ();
+};
+
+struct D : B {};
+
+template int Get();
+
+int main ()
+{
+ Get<&B::I>(); // { dg-error "not a valid template argument" "not valid" }
+ // { dg-error "no match" "no match" { target *-*-* } 18 }
+ // { dg-message "note" "note" { target *-*-* } 18 }
+ Get<&D::I>(); // { dg-error "not a valid template argument" "not valid" }
+ // { dg-error "no match" "no match" { target *-*-* } 21 }
+ // { dg-message "note" "note" { target *-*-* } 21 }
+}
ptrmem8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup3.C
===================================================================
--- lookup3.C (nonexistent)
+++ lookup3.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/12397
+
+struct foo { };
+
+template struct bar
+{
+ bar(){}
+ int i;
+ bar (const bar& foo) : i (foo.i) {}
+};
+
+int main()
+{
+ bar b1;
+ bar b2(b1);
+}
lookup3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static25.C
===================================================================
--- static25.C (nonexistent)
+++ static25.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/27819
+
+struct A
+{
+ static const char i = 1;
+};
+
+template struct B
+{
+ static const int j = A::i;
+ int x[int(j)];
+};
+
+B<0> b;
static25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error34.C
===================================================================
--- error34.C (nonexistent)
+++ error34.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/33842
+// { dg-do compile }
+
+template struct A
+{
+ A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
+};
+
+template struct B
+{
+ B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
+};
+
+template struct C
+{
+ C<__builtin_offsetof(T, x[6])>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\\[6\\\]\\)" }
+};
+
+template struct D
+{
+ D<__builtin_offsetof(T, x.y[6].z)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\\[6\\\].z\\)" }
+};
+
+struct E { int x; };
+
+template struct F
+{
+ F<__builtin_offsetof(E, x)>(); // { dg-error "type/value mismatch|offsetof\\(E, x\\)" }
+};
error34.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec25.C
===================================================================
--- spec25.C (nonexistent)
+++ spec25.C (revision 338)
@@ -0,0 +1,10 @@
+namespace N {
+ template
+ struct S {
+ void f() {}
+ };
+}
+
+namespace K {
+ template <> void N::S::f() {} // { dg-error "namespace|definition" }
+}
spec25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error17.C
===================================================================
--- error17.C (nonexistent)
+++ error17.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/20153
+
+template
+void
+foo()
+{
+ union { struct { }; }; // { dg-error "prohibits anonymous struct" "anon" }
+ // { dg-error "not inside" "not inside" { target *-*-* } 7 }
+ // { dg-warning "no members" "no members" { target *-*-* } 7 }
+}
error17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit-instantiation.C
===================================================================
--- explicit-instantiation.C (nonexistent)
+++ explicit-instantiation.C (revision 338)
@@ -0,0 +1,16 @@
+// Contributed by Gabriel Dos Reis
+// Origin: Jens.Maurer@gmx.net
+// { dg-do compile }
+
+// Fixed: PR 3381
+
+namespace N
+{
+ template
+ class A { };
+}
+
+template class ::N::A;
+
+
+
explicit-instantiation.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array6.C
===================================================================
--- array6.C (nonexistent)
+++ array6.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/15287
+
+struct S {};
+
+struct Array {
+ S operator[](int);
+} array;
+
+void (S::*mem_fun_ptr)();
+
+template void foo() {
+ (array[0].*mem_fun_ptr)();
+}
array6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void13.C
===================================================================
--- void13.C (nonexistent)
+++ void13.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/30299
+
+struct A
+{
+ int i;
+};
+
+template struct B : A // { dg-error "not a valid type" }
+{
+ B() { this->i; }
+};
void13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name3.C
===================================================================
--- dependent-name3.C (nonexistent)
+++ dependent-name3.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Dependent arrays of invalid size generate appropriate error messages
+
+template struct A
+{
+ static const int zero = 0;
+ static const int minus_one = -1;
+};
+
+template struct B
+{
+ int x[A::zero]; // { dg-error "zero" }
+ int y[A::minus_one]; // { dg-error "negative" }
+};
+
+B<0> b;
dependent-name3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash82.C
===================================================================
--- crash82.C (nonexistent)
+++ crash82.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/37649
+
+struct A
+{
+ template struct {}; // { dg-error "template class without a name" }
+};
crash82.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae15.C
===================================================================
--- sfinae15.C (nonexistent)
+++ sfinae15.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/40944
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+template
+struct make { static T&& it(); };
+
+void (*pf)(int&) = 0;
+
+template< typename T >
+int bar(T const& x,
+ decltype( pf(make::it()) )* = 0 // SFINAE!
+ ) {
+ return 1;
+}
+
+int bar(...) {
+ return 0;
+}
+
+int main() {
+ return bar(42);
+}
sfinae15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash65.C
===================================================================
--- crash65.C (nonexistent)
+++ crash65.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/29732
+
+struct A
+{
+ template template friend void foo(T) {} // { dg-error "parameter" }
+ void bar() { foo(0); } // { dg-error "foo" }
+};
crash65.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access19.C
===================================================================
--- access19.C (nonexistent)
+++ access19.C (revision 338)
@@ -0,0 +1,24 @@
+/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
+/* { dg-do "compile" } */
+
+template< class T >
+class explicit_t
+{
+public:
+ explicit_t( const T& c ): value( c ) { }
+ operator T&() { return value; }
+private:
+ template< class U >
+ explicit_t( U t ); /* { dg-error "with U = char, T = int|is private" } */
+ T value;
+};
+
+int foo( int x, explicit_t< int > y )
+{
+ return x + y;
+}
+
+int main()
+{
+ return foo( 5, 'c' ); /* { dg-error "this context" } */
+}
access19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-1.C
===================================================================
--- canon-type-1.C (nonexistent)
+++ canon-type-1.C (revision 338)
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+template < typename > struct A ;
+template < typename T , typename = A < T > > struct B { } ;
+template < class W , class > struct D
+{
+ typedef W X ;
+ A a ;
+};
+
+template < class Y > struct E
+{
+ B b ;
+} ;
+E e ;
+
canon-type-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static5.C
===================================================================
--- static5.C (nonexistent)
+++ static5.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Origin: Mirek Fidler
+// Wolfgang Bangerth
+
+// PR c++/12932: ICE address of static function as template argument
+
+struct Test {
+ static void fun();
+};
+
+template
+void foo () { (*fun)(); }
+
+
+template
+void foo ();
static5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash48.C
===================================================================
--- crash48.C (nonexistent)
+++ crash48.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/11471
+// Origin:
+// { dg-do compile }
+
+template struct A
+{
+ typedef typename T::X X;
+};
+
+template A::X::X() {} // { dg-error "no type|invalid use|not a type|dependent" }
crash48.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local2.C
===================================================================
--- local2.C (nonexistent)
+++ local2.C (revision 338)
@@ -0,0 +1,61 @@
+template
+struct X {
+ double & f (const unsigned int i,
+ const unsigned int j);
+ void g (X &M);
+};
+
+template
+void X::g (X &x) {
+ double t14 = x.f(0,0)*x.f(1,1);
+ double t15 = x.f(2,2)*x.f(3,3);
+ double t17 = x.f(2,3)*x.f(3,2);
+ double t19 = x.f(0,0)*x.f(2,1);
+ double t20 = x.f(1,2)*x.f(3,3);
+ double t22 = x.f(1,3)*x.f(3,2);
+ double t24 = x.f(0,0)*x.f(3,1);
+ double t25 = x.f(1,2)*x.f(2,3);
+ double t27 = x.f(1,3)*x.f(2,2);
+ double t29 = x.f(1,0)*x.f(0,1);
+ double t32 = x.f(1,0)*x.f(2,1);
+ double t33 = x.f(0,2)*x.f(3,3);
+ double t35 = x.f(0,3)*x.f(3,2);
+ double t37 = x.f(1,0)*x.f(3,1);
+ double t38 = x.f(0,2)*x.f(2,3);
+ double t40 = x.f(0,3)*x.f(2,2);
+ double t42 = t14*t15-t14*t17-t19*t20+t19*t22+
+ t24*t25-t24*t27-t29*t15+t29*t17+
+ t32*t33-t32*t35-t37*t38+t37*t40;
+ double t43 = x.f(2,0)*x.f(0,1);
+ double t46 = x.f(2,0)*x.f(1,1);
+ double t49 = x.f(2,0)*x.f(3,1);
+ double t50 = x.f(0,2)*x.f(1,3);
+ double t52 = x.f(0,3)*x.f(1,2);
+ double t54 = x.f(3,0)*x.f(0,1);
+ double t57 = x.f(3,0)*x.f(1,1);
+ double t60 = x.f(3,0)*x.f(2,1);
+ double t63 = t43*t20-t43*t22-t46*t33+t46*t35+
+ t49*t50-t49*t52-t54*t25+t54*t27+
+ t57*t38-t57*t40-t60*t50+t60*t52;
+ double t65 = 1/(t42+t63);
+ double t71 = x.f(0,2)*x.f(2,1);
+ double t73 = x.f(0,3)*x.f(2,1);
+ double t75 = x.f(0,2)*x.f(3,1);
+ double t77 = x.f(0,3)*x.f(3,1);
+ double t81 = x.f(0,1)*x.f(1,2);
+ double t83 = x.f(0,1)*x.f(1,3);
+ double t85 = x.f(0,2)*x.f(1,1);
+ double t87 = x.f(0,3)*x.f(1,1);
+ double t101 = x.f(1,0)*x.f(2,2);
+ double t103 = x.f(1,0)*x.f(2,3);
+ double t105 = x.f(2,0)*x.f(1,2);
+ double t107 = x.f(2,0)*x.f(1,3);
+ double t109 = x.f(3,0)*x.f(1,2);
+ double t111 = x.f(3,0)*x.f(1,3);
+ double t115 = x.f(0,0)*x.f(2,2);
+ double t117 = x.f(0,0)*x.f(2,3);
+ double t119 = x.f(2,0)*x.f(0,2);
+ double t121 = x.f(2,0)*x.f(0,3);
+}
+
+template void X::g (X&);
local2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new8.C
===================================================================
--- new8.C (nonexistent)
+++ new8.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/34336
+// { dg-do compile }
+
+struct A;
+
+template
+struct S
+{
+ T *m;
+ T &operator* () { return *m; }
+};
+
+struct B
+{
+ B (const A &);
+};
+
+template
+struct C
+{
+ C ();
+ S c;
+};
+
+template
+C::C ()
+{
+ B *b = new B (*c);
+}
new8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend39.C
===================================================================
--- friend39.C (nonexistent)
+++ friend39.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/8355
+
+namespace Foo { template void foo();}
+struct Bar
+{
+ friend void Foo::foo();
+};
friend39.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: class1.C
===================================================================
--- class1.C (nonexistent)
+++ class1.C (revision 338)
@@ -0,0 +1,9 @@
+extern const int a;
+
+template class X {};
+
+template struct Y {
+ X x;
+};
+
+template struct Y;
class1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg10.C
===================================================================
--- defarg10.C (nonexistent)
+++ defarg10.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/28363
+// { dg-do compile }
+
+template class = T> // { dg-error "invalid use of type" }
+struct A;
+
+typedef int I;
+template class = I> // { dg-error "invalid use of type" }
+struct B;
+
+struct S;
+template class = S> // { dg-error "invalid use of type" }
+struct C;
defarg10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor2.C
===================================================================
--- ctor2.C (nonexistent)
+++ ctor2.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do run }
+
+int i;
+
+template
+struct S
+{
+ S () { i = 1; }
+};
+
+static S s[1];
+
+int main ()
+{
+ if (!i)
+ return 1;
+}
+
ctor2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init8.C
===================================================================
--- init8.C (nonexistent)
+++ init8.C (revision 338)
@@ -0,0 +1,68 @@
+// PR c++/36089
+// { dg-do run }
+
+extern "C" void abort ();
+
+int f ()
+{
+ const int c(2);
+ int d[c] = { 0, 0 };
+ return d[0] + sizeof d;
+}
+
+struct A
+{
+ static int f ()
+ {
+ const int c(2);
+ int d[c] = { 0, 0 };
+ return d[0] + sizeof d;
+ }
+};
+
+template struct B
+{
+ static int f ()
+ {
+ const int c = 2;
+ int d[c] = { 0, 0 };
+ return d[0] + sizeof d;
+ }
+};
+
+template struct C
+{
+ static int f ()
+ {
+ const int c(2);
+ int d[c] = { 0, 0 };
+ return d[0] + sizeof d;
+ }
+};
+
+template struct D
+{
+ static int f ()
+ {
+ const int e(2);
+ const int c(e);
+ int d[c] = { 0, 0 };
+ return d[0] + sizeof d;
+ }
+};
+
+int
+main (void)
+{
+ int v = f ();
+ if (v != 2 * sizeof (int))
+ abort ();
+ if (v != A::f ())
+ abort ();
+ if (v != B<6>::f ())
+ abort ();
+ if (v != C<0>::f ())
+ abort ();
+ if (v != D<1>::f ())
+ abort ();
+}
init8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call1.C
===================================================================
--- call1.C (nonexistent)
+++ call1.C (revision 338)
@@ -0,0 +1,17 @@
+//Origin: harinath@cs.umn.edu
+//PR c++/10804
+// G++ was not emiting the function foo.
+
+// { dg-do run }
+
+
+template
+struct A
+{
+ A() { const void (*a)() = foo; }
+ static const void foo() {}
+};
+int main(int argc, char *argv[])
+{
+ A a;
+}
call1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static17.C
===================================================================
--- static17.C (nonexistent)
+++ static17.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/23896
+
+template struct X {};
+
+template struct length {
+ static const int value = 2;
+};
+
+template void foo () {
+ sizeof(X::value>);
+}
+
+template void foo();
static17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype12.C
===================================================================
--- nontype12.C (nonexistent)
+++ nontype12.C (revision 338)
@@ -0,0 +1,35 @@
+// PR c++/20172
+// Origin: Volker Reichelt
+
+template struct A
+{
+ template int foo(); // { dg-error "double" }
+ template class> int bar(); // { dg-error "double" }
+ template struct X; // { dg-error "double" }
+};
+
+A a1;
+A a2; // { dg-message "instantiated" }
+
+template struct B
+{
+ template int foo(); // { dg-error "double" }
+ template class> int bar(); // { dg-error "double" }
+ template struct X; // { dg-error "double" }
+};
+
+template int foo(); // { dg-error "void" }
+template class> int bar(); // { dg-error "void" }
+template struct X; // { dg-error "void" }
+
+template struct C
+{
+ template int foo(); // { dg-error "double" }
+};
+
+template int baz(T) { C c; } // { dg-message "instantiated" }
+
+void foobar()
+{
+ baz(1.2); // { dg-message "instantiated" }
+}
nontype12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: arg7.C
===================================================================
--- arg7.C (nonexistent)
+++ arg7.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/27425, 34274
+
+template struct A
+{
+ template class> struct B {}; // { dg-error "void|mismatch|expected" }
+ // { dg-bogus "not supported" "" { target *-*-* } 5 }
+ template struct C; // { dg-error "void" }
+ B b;
+};
+
+A a; // { dg-message "instantiated" }
arg7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error43.C
===================================================================
--- error43.C (nonexistent)
+++ error43.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/29363
+
+template void foo()
+{
+ throw A(); // { dg-message "declar" }
+ struct A {} a;
+}
+
+template void foo<0>(); // { dg-message "instantiated" }
error43.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig4.C
===================================================================
--- koenig4.C (nonexistent)
+++ koenig4.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/13978
+
+namespace ns {
+ template void func1(TP* t);
+ struct A {};
+}
+
+template < class TP >
+void func2() {
+ func1( new ns::A() );
+}
+
koenig4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec34.C
===================================================================
--- spec34.C (nonexistent)
+++ spec34.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/26988
+
+struct B{};
+
+struct Bar : virtual B {
+ template Bar( T const& cast );
+};
+
+template <> Bar::Bar( int const & cast ) {}
spec34.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error26.C
===================================================================
--- error26.C (nonexistent)
+++ error26.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/32112
+
+template struct A;
+
+template void foo (A<&T::template i>); // { dg-error "T:: ?template i|mismatch|& T::i" }
error26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec17.C
===================================================================
--- spec17.C (nonexistent)
+++ spec17.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/16224
+
+namespace io {
+ template int foo(); // { dg-error "" }
+}
+
+using namespace io;
+
+template<> int foo(); // { dg-error "" }
+
+int a = foo();
spec17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp17.C
===================================================================
--- qualttp17.C (nonexistent)
+++ qualttp17.C (revision 338)
@@ -0,0 +1,25 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+// { dg-options "-fno-inline -fabi-version=1 -Wno-abi" }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> struct X
+{
+};
+
+template void f(X)
+{
+}
+
+int main()
+{
+ X x;
+ f(x);
+}
+
+// { dg-final { scan-assembler "\n_?_Z1fI1AEv1XIN1T1BEE\[: \t\n\]" } }
qualttp17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem14.C
===================================================================
--- ptrmem14.C (nonexistent)
+++ ptrmem14.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/15875
+
+struct A
+{
+ void foo();
+};
+
+template void bar()
+{
+ typedef void (A::*fptr)();
+ fptr ptr = &A::foo;
+}
ptrmem14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond6.C
===================================================================
--- cond6.C (nonexistent)
+++ cond6.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/27801
+
+template int foo(int i)
+{
+ return !( (1 && i) ? 0 : 1 );
+}
cond6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using5.C
===================================================================
--- using5.C (nonexistent)
+++ using5.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Jul 2003
+
+// PR 9447. further test cases for dependent using decl
+
+template struct Base;
+
+template struct Derived : public Base {
+ using Base::i;
+
+ Derived() { i; }
+
+ int get_i() { return i.f(); }
+
+};
using5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash91.C
===================================================================
--- crash91.C (nonexistent)
+++ crash91.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/28293
+
+template void foo();
+
+struct A
+{
+ typedef void foo<0>(); // { dg-error "explicit template argument list not allowed" }
+};
crash91.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash74.C
===================================================================
--- crash74.C (nonexistent)
+++ crash74.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/34089
+// { dg-do compile }
+// { dg-options "" }
+
+template void foo () { }
+template struct foo { }; // { dg-error "redeclared as" }
crash74.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash57.C
===================================================================
--- crash57.C (nonexistent)
+++ crash57.C (revision 338)
@@ -0,0 +1,10 @@
+//PR c++/27397
+
+template struct A; // { dg-error "token" }
+
+template struct B
+{
+ template struct C; // { dg-error "token" }
+};
+
+A a; // { dg-error "type/value mismatch|constant|declaration" }
crash57.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualified-id1.C
===================================================================
--- qualified-id1.C (nonexistent)
+++ qualified-id1.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Sep 2003
+// Origin Volker Reichelt reichelt@igpm.rwth-aachen.de
+
+// PR 11922
+
+struct A
+{
+ template struct B;
+ struct C;
+};
+
+template <> struct A::B {};
+
+template void foo()
+{
+ T::C (); // { dg-error "parsed as a non-type|if a type is meant" }
+ T::template B(); // { dg-error "parsed as a non-type" "non-type" }
+ // { dg-message "if a type" "if a type" { target *-*-* } 20 }
+}
+
+void bar()
+{
+ foo(); // { dg-message "instantiated" }
+}
qualified-id1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype3.C
===================================================================
--- nontype3.C (nonexistent)
+++ nontype3.C (revision 338)
@@ -0,0 +1,37 @@
+// { dg-do compile }
+// Origin: ,
+//
+// c++/13243: Template parameters of non integral or enumeration type can't be
+// used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
+// invalid too.
+
+template class foo {};
+template class bar {};
+
+template
+void dep5(bar *);
+
+template
+void dep6(bar *); // { dg-error "" "integral or enumeration" }
+
+template
+void dep7(bar *);
+
+template
+void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" }
+
+template
+void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" }
+
+template
+void dep9a(foo< sizeof(*PI) > *);
+
+template
+void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
+
+template
+void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
+
+template
+void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
+
nontype3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error7.C
===================================================================
--- error7.C (nonexistent)
+++ error7.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/13314
+// { dg-options "-O2" }
+
+struct A { template struct B; };
+struct A::B {}; // { dg-error "" }
+A::B<0> b; // { dg-error "" }
error7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec7.C
===================================================================
--- spec7.C (nonexistent)
+++ spec7.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// PR c++/6440: Specialization of member class template.
+
+template struct A
+{
+ template struct B {};
+};
+
+template<> template
+struct A::B
+{
+ void f();
+ template void g(V);
+};
+
+template<> template<> template void A::B::g(V)
+{
+}
+
+A::B b;
+
+int h()
+{
+ b.f();
+ b.g(0);
+}
spec7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp7.C
===================================================================
--- qualttp7.C (nonexistent)
+++ qualttp7.C (revision 338)
@@ -0,0 +1,12 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template class TT> class C {
+};
+
+template struct D {
+ C c; // { dg-error "no class template" }
+};
+
+D d; // { dg-message "instantiated" }
qualttp7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify9.C
===================================================================
--- unify9.C (nonexistent)
+++ unify9.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jul 2005
+
+// Origin:Wolfgang Bangerth
+// PR 21799: deduction of cvqualifiers on member functions was wrong
+
+template void f (T &, void (T::*)() );
+
+struct X {
+ void g() const {}
+};
+
+const X *x;
+
+int main () {
+ f (*x, &X::g); // { dg-error "no matching function" }
+}
unify9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename10.C
===================================================================
--- typename10.C (nonexistent)
+++ typename10.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Aug 2006
+
+// Origin: Tobias Schwinger
+// PR 27787. Too eager to resolve a typename
+
+template
+struct x
+{
+ template
+ struct y
+ {
+ typedef Y type;
+ };
+};
+
+template
+struct a : x
+{
+ template
+ typename a::template y::type f(B);
+};
typename10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend48.C
===================================================================
--- friend48.C (nonexistent)
+++ friend48.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/29020
+
+template struct A
+{
+ void foo();
+};
+
+struct B
+{
+ template friend void A::A::foo();
+};
+
friend48.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mangle1.C
===================================================================
--- mangle1.C (nonexistent)
+++ mangle1.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/17324
+// { dg-do assemble }
+
+template struct A
+{
+ template void foo(const A&) {}
+};
+
+template struct B
+{
+ template void bar(const A&);
+ void baz() { A<0,B>().foo(A<0,B>()); }
+};
+
+template struct B;
+template struct B;
mangle1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof6.C
===================================================================
--- sizeof6.C (nonexistent)
+++ sizeof6.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// Contributed by Giovanni Bajo
+// PR c++/13683: bogus warning about passing non-PODs through ellipsis
+
+struct B {};
+struct NonPOD : B {};
+
+struct A
+{
+ static int check(...);
+ static NonPOD GetNonPOD(void);
+ enum { value = sizeof(A::check(A::GetNonPOD())) };
+};
sizeof6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass1.C
===================================================================
--- memclass1.C (nonexistent)
+++ memclass1.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt
+
+// PR c++/10555: ICE for member class template when one of the
+// template argument levels contains errors.
+
+template struct A
+{
+ template struct B;
+};
+
+template struct C
+{
+ typedef typename A::template B X; // { dg-error "declared|invalid" }
+};
+
+C c;
memclass1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void7.C
===================================================================
--- void7.C (nonexistent)
+++ void7.C (revision 338)
@@ -0,0 +1,8 @@
+//PR c++/28741
+
+template struct A // { dg-error "not a valid type" }
+{
+ static int i;
+};
+
+A<0> a; // { dg-error "invalid type|not a valid type" }
void7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend3.C
===================================================================
--- memfriend3.C (nonexistent)
+++ memfriend3.C (revision 338)
@@ -0,0 +1,55 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function of class template as friend
+
+template struct A
+{
+ void f(T);
+};
+
+class C {
+ int i;
+ template friend void A::f(T);
+};
+
+template struct A
+{
+ void f(T*);
+};
+
+template<> struct A
+{
+ void f(char);
+};
+
+template void A::f(T)
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::f(T*)
+{
+ C c;
+ c.i = 0;
+}
+
+void A::f(char)
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A a1;
+ a1.f(0);
+ A a2;
+ int *p = 0;
+ a2.f(p);
+ A a3;
+ a3.f('a');
+}
memfriend3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend3.C
===================================================================
--- friend3.C (nonexistent)
+++ friend3.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Dec 2001
+
+// PR 775 friend classes with qualified names inside template classes.
+
+struct A
+{
+ struct B {
+ B () { }
+ };
+};
+
+template
+struct C: A {
+ friend A::B::B (); // 2.95.2 ICE
+ friend struct A;
+ friend struct A::B; // 2.97 error
+};
+
+template class C;
+
+template class TPL
+{
+ class nested;
+};
+
+template class TPL::nested
+{
+};
friend3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp6.C
===================================================================
--- ttp6.C (nonexistent)
+++ ttp6.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Eelis van der Weegen
+
+// PR c++/10552: Member class template as template template argument
+// substitution issue.
+
+template class A, typename>
+struct B
+{
+ typedef typename A::t t;
+};
+
+template
+struct E
+{
+ template struct F { typedef int t; };
+ typedef typename B::t t;
+};
+
+typedef E::t t;
ttp6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem9.C
===================================================================
--- ptrmem9.C (nonexistent)
+++ ptrmem9.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/15329
+
+struct S {};
+
+template struct X {
+ S s;
+ void foo (void (S::*p)())
+ { (s.*p)(); }
+};
ptrmem9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array1-1.C
===================================================================
--- array1-1.C (nonexistent)
+++ array1-1.C (revision 338)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1" }
+
+// Contributed by Nathan Sidwell 22 Dec 2003
+// Origin: Roger Sayle
+
+// PR c++/12774 Array domains compared unequal
+
+void Foo(double r[3][3])
+{
+}
+
+void Baz()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+template
+void Bar()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+int main()
+{
+ Baz();
+ Bar();
+ return 0;
+}
+
array1-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup4.C
===================================================================
--- lookup4.C (nonexistent)
+++ lookup4.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/13950
+
+template struct Base {};
+template struct Derived: public Base {
+ typename Derived::template Base* p1;
+};
lookup4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static26.C
===================================================================
--- static26.C (nonexistent)
+++ static26.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/28016
+// { dg-final { scan-assembler-not "computed" } }
+
+template
+struct scalar_divides_assign {
+ static const bool computed ;
+};
+
+template
+const bool scalar_divides_assign::computed = true;
static26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error35.C
===================================================================
--- error35.C (nonexistent)
+++ error35.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/33494
+
+template void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }
error35.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec26.C
===================================================================
--- spec26.C (nonexistent)
+++ spec26.C (revision 338)
@@ -0,0 +1,35 @@
+// dg-do run
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 16 Sep 2005
+
+// PR 23519 template specialization ordering (DR214)
+// Origin: Maxim Yegorushkin
+
+struct A
+{
+ template int operator+(T&) { return 1;}
+};
+
+template struct B
+{
+ int operator-(A&) {return 2;}
+ template int operator*(R&) {return 3;}
+};
+
+template int operator-(B, R&) {return 4;}
+template int operator+(A&, B&) { return 5;}
+template int operator*(T &, A&){return 6;}
+
+int main()
+{
+ A a;
+ B b;
+ if ((a + b) != 5)
+ return 1;
+
+ if ((b - a) != 2)
+ return 2;
+
+ if ((b * a) != 6)
+ return 3;
+}
spec26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error18.C
===================================================================
--- error18.C (nonexistent)
+++ error18.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/20157
+
+template
+struct A{
+ template
+ void function(T);
+};
+
+template<>
+template
+void A::function(ABC); // { dg-error "match" }
error18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array7.C
===================================================================
--- array7.C (nonexistent)
+++ array7.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/16246
+
+template void foo (T, T);
+
+template
+int bar( const char(&val)[M] )
+{
+ foo (N,M);
+}
+
+int i = bar<10>("1234");
array7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void14.C
===================================================================
--- void14.C (nonexistent)
+++ void14.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/36411
+// { dg-do compile }
+
+template class> struct A // { dg-error "not a valid type" }
+{
+ template class T> A foo(); // { dg-error "mismatch|expected|invalid" }
+};
void14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend.C
===================================================================
--- friend.C (nonexistent)
+++ friend.C (revision 338)
@@ -0,0 +1,29 @@
+// Contribued by Gabriel Dos Reis
+// Origin: iskey@i100.ryd.student.liu.se
+
+class ostream;
+extern ostream& cout;
+
+template struct s;
+
+template
+ostream& operator<<(ostream &o, const typename s::t &x)
+{
+ return o;
+}
+
+template
+struct s {
+ struct t
+ {
+ friend ostream&
+ operator<<(ostream&, const typename s::t &);
+ };
+ t x;
+};
+
+int main()
+{
+ s::t y;
+ cout << y; // { dg-error "" }
+}
friend.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp10.C
===================================================================
--- ttp10.C (nonexistent)
+++ ttp10.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+// Wolfgang Bangerth
+
+// PR c++/16175: Missing cv qualifier in error message output
+
+template struct Template {};
+
+template class D>
+struct B {
+ static void foo1(const D *); // { dg-error "const" }
+ static void foo2(volatile D *);// { dg-error "volatile" }
+};
+
+class E : protected B {};
+
+void bar() {
+ E::foo1 (0); // { dg-error "context" }
+ E::foo2 (0); // { dg-error "context" }
+}
ttp10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name4.C
===================================================================
--- dependent-name4.C (nonexistent)
+++ dependent-name4.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Dependent arrays of invalid size cause template instantiation failure.
+
+// We'll get an error message (duplicate matching templates) if the first
+// pattern is incorrectly allowed to match.
+
+template void foobar (int (*) [M] = 0 );
+template void foobar ( );
+
+void fn (void)
+{
+ foobar<0>();
+ foobar<-1>();
+}
dependent-name4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pseudodtor1.C
===================================================================
--- pseudodtor1.C (nonexistent)
+++ pseudodtor1.C (revision 338)
@@ -0,0 +1,44 @@
+// PR c++/32384
+// { dg-do compile }
+
+struct A
+{
+ typedef int T;
+ T foo ();
+
+ A () { foo ().~T (); }
+};
+
+template struct B
+{
+ typedef int T;
+ T foo ();
+
+ B () { foo ().~T (); }
+};
+
+template struct C
+{
+ T t;
+ C () { t.~T (); }
+};
+
+template struct D
+{
+ typedef int T;
+ S foo ();
+
+ D () { foo ().~T(); }
+};
+
+struct Z
+{
+ Z () {}
+ ~Z () {}
+};
+
+A a;
+B b;
+C c1;
+C c2;
+D d;
pseudodtor1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash83.C
===================================================================
--- crash83.C (nonexistent)
+++ crash83.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/37650
+
+template struct A {};
+
+template: > struct B {}; // { dg-error "explicit specialization|expected" }
crash83.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae16.C
===================================================================
--- sfinae16.C (nonexistent)
+++ sfinae16.C (revision 338)
@@ -0,0 +1,34 @@
+// PR c++/41927
+// { dg-options "-std=c++0x -Wall" }
+
+// We were getting a spurious ||/&& warning about the enable_if with the
+// source position of d1.
+
+template
+ struct is_int
+ { static const bool value = true; };
+
+template
+ struct enable_if
+ { };
+
+template
+ struct enable_if
+ { typedef Tp type; };
+
+template
+ struct duration
+ {
+ duration() { }
+
+ template::value)>::type>
+ duration(const duration&) { }
+ };
+
+int main()
+{
+ duration d0;
+ duration d1 = d0;
+}
+
sfinae16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash66.C
===================================================================
--- crash66.C (nonexistent)
+++ crash66.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/29535
+// { dg-do compile }
+
+template struct SetRegion2D
+{
+ struct FloodFillControl
+ {
+ struct Allocator{};
+ };
+};
+template
+struct MotionSearcher
+{
+ typedef SetRegion2D Region_t;
+ MotionSearcher (typename Region_t::FloodFillControl::Allocator &a_rAllocator);
+};
+class MotionSearcherY : public MotionSearcher<1, int> {};
crash66.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-2.C
===================================================================
--- canon-type-2.C (nonexistent)
+++ canon-type-2.C (revision 338)
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+template < typename > struct A ;
+template < typename T , typename = A < T > > struct B { } ;
+template < class W , class > struct D
+{
+ typedef W X ;
+ A< X()> a ;
+};
+
+template < class Y > struct E
+{
+ B< Y()> b ;
+};
+E e ;
+
canon-type-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static6.C
===================================================================
--- static6.C (nonexistent)
+++ static6.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/13969
+
+struct B {
+ static const int N=10;
+};
+
+template struct X {};
+
+template struct S {
+ static const int N = B::N;
+ X x;
+};
+
+template class S;
static6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash49.C
===================================================================
--- crash49.C (nonexistent)
+++ crash49.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/27102
+
+template
+void T::foo; // { dg-error "invalid" }
crash49.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local3.C
===================================================================
--- local3.C (nonexistent)
+++ local3.C (revision 338)
@@ -0,0 +1,14 @@
+ template
+ void f(const T&)
+ {
+ struct B {
+
+ void g (T);
+ };
+ B b;
+ }
+ void g()
+ {
+ f(42);
+ }
+
local3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: class2.C
===================================================================
--- class2.C (nonexistent)
+++ class2.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/13451
+
+template
+struct A {
+ struct B;
+ struct A::B { }; // { dg-error "" }
+};
class2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg11.C
===================================================================
--- defarg11.C (nonexistent)
+++ defarg11.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// We used to reject this code as the extension
+// for default arguments being accepted as less the
+// needed template arguments.
+
+
+template struct match { };
+
+template class t,typename T>
+struct match > { typedef int type; };
+
+template class t,typename T0,typename T1>
+struct match > { typedef int type; };
+
+template struct other { };
+
+typedef match >::type type;
defarg11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor3.C
===================================================================
--- ctor3.C (nonexistent)
+++ ctor3.C (revision 338)
@@ -0,0 +1,19 @@
+struct A {};
+struct B;
+
+template struct X: virtual A {
+ template X(TP2* ptr) {}
+ template X(const X) {}
+};
+
+struct Y : X {
+ Y(A* a) : X(a) {}
+};
+
+void func1(X);
+
+void func2() {
+ A a;
+ Y y(&a);
+ func1(X(&a));
+}
ctor3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call2.C
===================================================================
--- call2.C (nonexistent)
+++ call2.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/13592
+
+struct S {
+ void operator()(int);
+};
+
+struct A {
+ template void foo();
+ S s;
+};
+
+template void A::foo() {
+ s(0);
+}
call2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: expr1.C
===================================================================
--- expr1.C (nonexistent)
+++ expr1.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/18161
+// { dg-options "" }
+
+template struct Y;
+template <> struct Y {};
+
+template struct X { Y a; };
+template struct X <>;
expr1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inline1.C
===================================================================
--- inline1.C (nonexistent)
+++ inline1.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// { dg-options "-fno-default-inline -O0" }
+// { dg-final { scan-assembler-not "\n_?_ZN1X3FooIiEEvT_\[: \t\n\]" } }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Mar 2003
+
+// PR 10047. bogus warning.
+
+struct X
+{
+ template static void Foo (T) {}
+};
+
+extern template void X::Foo (int); // extern, so don't emit it
+
+int main () {
+ X::Foo (1); // ok, we've seen the defn
+}
+
inline1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static18.C
===================================================================
--- static18.C (nonexistent)
+++ static18.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/23914
+
+template
+struct foo_template {
+ static const unsigned complexity = 0;
+};
+
+template struct STATIC_ASSERTION {};
+
+void gcc_402_problem_minimal()
+{
+ sizeof(STATIC_ASSERTION< foo_template::complexity >);
+}
static18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype13.C
===================================================================
--- nontype13.C (nonexistent)
+++ nontype13.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/19004
+
+template
+struct Dummy
+{
+ void evil()
+ {
+ this->template tester();
+ }
+
+ template
+ void tester()
+ {
+ bar()(); // { dg-error "constant" }
+ }
+ template
+ struct bar
+ {
+ void operator()()
+ { }
+ };
+};
+
+int main()
+{
+ Dummy d;
+ d.tester (); // { dg-message "instantiated" }
+}
+
nontype13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error44.C
===================================================================
--- error44.C (nonexistent)
+++ error44.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/32056
+
+template struct A {}; // { dg-error "storage class specified" }
+template struct B {}; // { dg-error "storage class specified" }
+template struct C {}; // { dg-error "storage class specified" }
+template struct D {}; // { dg-error "storage class specified" }
+template struct E {}; // { dg-error "storage class specified" }
error44.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig5.C
===================================================================
--- koenig5.C (nonexistent)
+++ koenig5.C (revision 338)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// Contributed by David Abrahams
+// PR c++/14143: Koenig lookup should only look into template arguments only
+// if the argument is a template-id.
+
+namespace fu
+{
+ template
+ struct bar
+ {
+ struct baz {};
+ };
+}
+
+namespace axe
+{
+ struct handle {};
+
+ template
+ char* f(T&);
+}
+
+namespace test
+{
+ template
+ int f(T const&);
+
+ template
+ int g(T x) { return f(x); }
+
+ int x = g(fu::bar::baz());
+}
koenig5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec35.C
===================================================================
--- spec35.C (nonexistent)
+++ spec35.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/31923
+// C++ DR 605 -- "...the linkage of an explicit specialization must be that of
+// the template."
+
+// { dg-require-weak "" }
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+
+template
+static void f1 (T) { }
+
+// { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IfEvT_" } }
+template<>
+void f1 (float) { } // Expected to have static linkage
+
+template
+void f2 (T) { }
+
+// { dg-final { scan-assembler ".glob(a|)l\[\t \]*_?_Z2f2IfEvT_" } }
+template<>
+void f2 (float) { } // Expected to have global linkage
+
+void instantiator ()
+{
+ // { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IiEvT_" } }
+ f1(0); // Expected to have static linkage
+
+ // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" { target { ! { *-*-mingw* *-*-cygwin } } } } }
+ f2(0); // Expected to have weak global linkage
+}
spec35.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error27.C
===================================================================
--- error27.C (nonexistent)
+++ error27.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/27211
+
+struct A {};
+
+template void A::foo() {} // { dg-error "member function" }
error27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec18.C
===================================================================
--- spec18.C (nonexistent)
+++ spec18.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/17936
+
+template struct A
+{
+ void foo();
+};
+
+template struct A<1, N>
+{
+ void foo();
+};
+
+template<> void A<1, 2>::foo();
spec18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp18.C
===================================================================
--- qualttp18.C (nonexistent)
+++ qualttp18.C (revision 338)
@@ -0,0 +1,23 @@
+// Copyright (C) 2001, 2002 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+struct A
+{
+ template class B {};
+};
+
+template class TT> struct X
+{
+ TT y;
+};
+
+struct C
+{
+ X x; // { dg-error "" }
+};
+
+int main()
+{
+ C c;
+}
qualttp18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate1.C
===================================================================
--- instantiate1.C (nonexistent)
+++ instantiate1.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// Origin:
+
+// PR c++/6716
+// ICE in complex class structure when components are incomplete
+
+template struct X {
+ T t; // { dg-error "incomplete" }
+};
+
+template struct Y {
+ X x; // { dg-message "instantiated" }
+};
+
+template struct Z { // { dg-error "declaration" }
+ Y > y; // { dg-message "instantiated" }
+};
+
+struct ZZ : Z
+{
+};
instantiate1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem15.C
===================================================================
--- ptrmem15.C (nonexistent)
+++ ptrmem15.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/19894
+// Origin: Volker Reichelt
+
+template struct A
+{
+ T A::* p; // { dg-error "void" }
+};
+
+A a; // { dg-message "instantiated" }
ptrmem15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond7.C
===================================================================
--- cond7.C (nonexistent)
+++ cond7.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/34270
+// { dg-do compile }
+// { dg-options "" }
+
+void foo ()
+{
+ __typeof__ (0 ?: 0) x;
+ __decltype (0 ?: 0) y;
+}
+
+template void bar ()
+{
+ __typeof__ (0 ?: 0) x;
+ __decltype (0 ?: 0) y;
+}
cond7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using6.C
===================================================================
--- using6.C (nonexistent)
+++ using6.C (revision 338)
@@ -0,0 +1,14 @@
+namespace foo {
+ template
+ struct A {};
+}
+
+namespace bar {
+ template
+ struct A {};
+}
+
+namespace foo {
+ using bar::A; // { dg-error "" }
+}
+
using6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash92.C
===================================================================
--- crash92.C (nonexistent)
+++ crash92.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/42055
+
+template void foo(T, T); // { dg-error "candidates|template" }
+
+template void foo(T, int); // { dg-error "template" }
+
+template void foo(int, int); // { dg-error "ambiguous template specialization" }
crash92.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash75.C
===================================================================
--- crash75.C (nonexistent)
+++ crash75.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/34776
+
+template struct A
+{
+ T::X<0> x; // { dg-error "non-template|T::template|base type" }
+};
+
+A a;
crash75.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial1.C
===================================================================
--- partial1.C (nonexistent)
+++ partial1.C (revision 338)
@@ -0,0 +1,36 @@
+// { dg-do run }
+// Origin: Jo Totland
+
+// PR c++/6620
+// Partial specialization involving expression of non-type template
+// parameter causes ICE.
+
+extern "C" void abort();
+
+template struct HoldInt
+{
+};
+
+template struct Add
+{
+};
+
+template struct Add, HoldInt<-N> >
+{
+ typedef int type;
+ int f() { return 0; }
+};
+
+template
+struct Add, HoldInt >
+{
+ typedef HoldInt type;
+ int f() { return 1; }
+};
+
+int main() {
+ Add, HoldInt<-1> > a;
+ Add, HoldInt<-2> > b;
+ if (a.f() != 0 || b.f() != 1)
+ abort();
+}
partial1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash58.C
===================================================================
--- crash58.C (nonexistent)
+++ crash58.C (revision 338)
@@ -0,0 +1,10 @@
+//PR 26938
+
+template struct A; // { dg-message "previous declaration" }
+
+template struct A // { dg-error "template" }
+{
+ A();
+};
+
+A<0> a; // { dg-error "incomplete type" }
crash58.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualified-id2.C
===================================================================
--- qualified-id2.C (nonexistent)
+++ qualified-id2.C (revision 338)
@@ -0,0 +1,27 @@
+// PR c++/44587
+// { dg-do run }
+
+template struct A { static const char *p; };
+template const char *A::p = N;
+template struct B { static const char c[1]; typedef A::c> C; };
+template const char B::c[1] = "";
+template struct D { static const char c[1]; typedef A C; };
+template const char D::c[1] = "";
+
+template struct E { static int *ip; };
+template int* E::ip = &I;
+template struct F { static int i; typedef E::i> C; };
+template int F::i;
+template struct G { static int i; typedef E C; };
+template int G::i;
+
+#define AS(X) if (!(X)) return 1;
+int main()
+{
+ AS(B::C::p == B::c);
+ AS(B::C::p == B::c);
+ AS(B::C::p != B::c);
+ AS(D::C::p == D::c);
+ AS(D::C::p == D::c);
+ AS(D::C::p != D::c);
+}
qualified-id2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype4.C
===================================================================
--- nontype4.C (nonexistent)
+++ nontype4.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+// Volker Reichelt
+
+// PR c++/13797: ICE invalid nontype template parameter
+
+template struct A
+{
+ typedef A<0> B; // { dg-error "previous declaration" }
+ template struct B {}; // { dg-error "not a valid type|typedef" }
+};
+
+A<0> a;
nontype4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash1.C
===================================================================
--- crash1.C (nonexistent)
+++ crash1.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 5125. ICE
+
+class S
+{
+ public:
+ template void Foo(int (*f)(S& o) );
+};
+
+template
+void S::Foo(int (*f)(TYPO&o) ) // { dg-error "Foo|f|TYPO|o" }
+{
+}
crash1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error8.C
===================================================================
--- error8.C (nonexistent)
+++ error8.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/11116
+
+template struct S {};
+
+void f() {
+ throw S (); // { dg-error "template" }
+}
error8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec8.C
===================================================================
--- spec8.C (nonexistent)
+++ spec8.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Specialization of member class template.
+
+template struct A
+{
+ template struct B {};
+ template struct C {};
+};
+
+template <> template <> struct A::B;
+template <> template struct A::B {};
+A::B ab; // { dg-error "incomplete" }
+
+A::C ac;
+template <> template struct A::C {}; // { dg-error "specialization" }
spec8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp8.C
===================================================================
--- qualttp8.C (nonexistent)
+++ qualttp8.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template class TT> class C {
+};
+
+template struct D {
+ C c; // { dg-error "context" }
+};
+
+struct E {
+ private:
+ template class B {}; // { dg-error "private" }
+};
+
+D d; // { dg-message "instantiated" }
qualttp8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename11.C
===================================================================
--- typename11.C (nonexistent)
+++ typename11.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/28999
+
+namespace N
+{
+ template void foo();
+}
+
+template struct A
+{
+ friend void typename N::foo<0>(); // { dg-error "type|expected" }
+};
typename11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend49.C
===================================================================
--- friend49.C (nonexistent)
+++ friend49.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/29054
+// { dg-do compile }
+
+struct A
+{
+ template static void create (U) {}
+};
+
+struct B
+{
+ friend void A::create (const char *);
+};
+
+int
+main ()
+{
+ A::create("test");
+}
friend49.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof7.C
===================================================================
--- sizeof7.C (nonexistent)
+++ sizeof7.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Testcase by: bangerth@dealii.org
+// PR c++/10858: failure with calling a method inside sizeof in a template
+
+ template struct P {};
+
+ void bar ();
+
+ template struct X {
+ static int foo(void (*)());
+ P p;
+ };
+
+ template class X;
sizeof7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass2.C
===================================================================
--- memclass2.C (nonexistent)
+++ memclass2.C (revision 338)
@@ -0,0 +1,20 @@
+namespace ns {
+ template
+ struct Foo {
+ template struct Bar;
+ };
+
+ template
+ template
+ struct Foo::Bar {
+ template struct Baz;
+ };
+
+ template
+ template
+ template
+ struct Foo::Bar::Baz {
+ Foo chokes;
+ ns::Foo works;
+ };
+}
memclass2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void8.C
===================================================================
--- void8.C (nonexistent)
+++ void8.C (revision 338)
@@ -0,0 +1,7 @@
+//PR c++/28737
+
+template struct A; // { dg-error "not a valid type" }
+
+template struct B;
+
+template struct B > {}; // { dg-error "not a valid type|declared|invalid" }
void8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend4.C
===================================================================
--- memfriend4.C (nonexistent)
+++ memfriend4.C (revision 338)
@@ -0,0 +1,63 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function of class template as friend
+
+template struct A
+{
+ template void f();
+};
+
+class C {
+ int i;
+ template template friend void A::f();
+};
+
+template struct A
+{
+ template void f();
+};
+
+template<> struct A
+{
+ template void f();
+};
+
+template template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::f<'b'>()
+{
+ C c;
+ c.i = 0;
+}
+
+int d2 = 0;
+
+int main()
+{
+ A a1;
+ a1.f<0>();
+ A a2;
+ a2.f<&d2>();
+ A a3;
+ a3.f<'a'>();
+ a3.f<'b'>();
+}
memfriend4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend4.C
===================================================================
--- friend4.C (nonexistent)
+++ friend4.C (revision 338)
@@ -0,0 +1,46 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Dec 2001
+
+// PR 109, dependent member friends
+
+struct B
+{
+ static int foo ();
+ struct N
+ {
+ static int bar ();
+ };
+};
+
+
+template
+class A
+{
+ friend int T::foo ();
+ friend int T::N::bar ();
+
+ private:
+ static int m;
+};
+
+template
+class C
+{
+ friend struct T::N;
+
+ private:
+ static int m;
+};
+
+
+int B::foo ()
+{
+ return A::m;
+}
+
+int B::N::bar ()
+{
+ return A::m + C::m;
+}
friend4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp7.C
===================================================================
--- ttp7.C (nonexistent)
+++ ttp7.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// Contributed by Andrew Pinski
+// PR c++/13810: ICE while parsing invalid default argument for a
+// template template parameter.
+
+struct X;
+template struct A {};
+
+template class = X > struct B1 {}; // { dg-error "as a default value" }
+template class = A<0> > struct B2 {}; // { dg-error "as a default value" }
+
+template
+struct S {
+ template class = S> struct I1 {}; // { dg-error "as a default value" }
+ template class = ::S> struct I2 {};
+};
ttp7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array1-2.C
===================================================================
--- array1-2.C (nonexistent)
+++ array1-2.C (revision 338)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Contributed by Nathan Sidwell 22 Dec 2003
+// Origin: Roger Sayle
+
+// PR c++/12774 Array domains compared unequal
+
+void Foo(double r[3][3])
+{
+}
+
+void Baz()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+template
+void Bar()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+int main()
+{
+ Baz();
+ Bar();
+ return 0;
+}
+
array1-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup5.C
===================================================================
--- lookup5.C (nonexistent)
+++ lookup5.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/13925
+
+namespace N {
+ template void f(T);
+
+ namespace M {
+ class A {
+ friend void f(int);
+ };
+ }
+
+ template void f(T) {}
+ template <> void f(int )
+ {
+ f(0);
+ }
+}
lookup5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static27.C
===================================================================
--- static27.C (nonexistent)
+++ static27.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/28235
+
+template struct A
+{
+ static const bool i = true;
+ template struct B {};
+ B<> b;
+};
+
+void f() {
+ A a1, a2;
+ a1.b = a2.b;
+}
static27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error36.C
===================================================================
--- error36.C (nonexistent)
+++ error36.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/37719.C
+
+template
+class foo {
+ void bar() throw(int); // { dg-error "throw \\(int\\)" }
+};
+
+template <>
+void foo::bar() throw(float) {} // { dg-error "throw \\(float\\)" }
error36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec27.C
===================================================================
--- spec27.C (nonexistent)
+++ spec27.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/24139
+
+template
+struct O {
+ struct I;
+};
+
+template<>
+struct O::I
+{
+ I();
+};
+
+O::I::I() {}
spec27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error19.C
===================================================================
--- error19.C (nonexistent)
+++ error19.C (revision 338)
@@ -0,0 +1,22 @@
+// PR c++/23293
+
+template < typename > struct P;
+struct S;
+
+void *unrelated_function()
+{
+ typedef S K;
+ P < K > * p;
+ return p;
+}
+
+template < typename U >
+void generate_warning()
+{
+ U::x(); // { dg-error "P" }
+}
+
+int main()
+{
+ generate_warning< P < S > >();
+}
error19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array8.C
===================================================================
--- array8.C (nonexistent)
+++ array8.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/18121
+
+// We were trying to layout the array
+// type but since the type/value of A::i
+// was not known at template declation type,
+// we were crashing
+
+template struct A
+{
+ static int const i = 1;
+};
+
+template struct B
+{
+ typedef int (*p)[A::i];
+};
array8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: injected1.C
===================================================================
--- injected1.C (nonexistent)
+++ injected1.C (revision 338)
@@ -0,0 +1,33 @@
+// PR c++/13950, DR 176
+
+template struct Base { }; // { dg-error "" } candidate
+
+struct D1: Base
+{
+ D1::Base* p1;
+ D1::Base* p2;
+ Base *p3;
+ Base* p4;
+};
+
+struct D2: Base, Base
+{
+ D2::Base* p1; // { dg-error "" }
+ D2::Base* p2;
+ Base *p3; // { dg-error "" }
+ Base* p4;
+};
+
+template
+struct D3: Base {
+ typename D3::Base* p1;
+ typename D3::template Base* p2;
+};
+template struct D3;
+
+template
+struct D4: Base, Base {
+ typename D4::Base* p1; // { dg-error "" }
+ typename D4::template Base* p2;
+};
+template struct D4; // { dg-message "instantiated" }
injected1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp11.C
===================================================================
--- ttp11.C (nonexistent)
+++ ttp11.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: heinlein@informatik.uni-ulm.de
+
+// PR c++/14429: Matching of template template parameter containing
+// non-type parameter with type that depends on earlier parameter.
+
+template class T>
+struct X {};
+
+template class T>
+struct Y {
+ X x;
+};
ttp11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name5.C
===================================================================
--- dependent-name5.C (nonexistent)
+++ dependent-name5.C (revision 338)
@@ -0,0 +1,45 @@
+// PR c++/9634, c++/29469, c++/29607
+// Contributed by: Giovanni Bajo
+// DR224: Make sure that a name is *truly* semantically dependent.
+
+struct D {
+ typedef int K;
+};
+
+template
+struct A
+{
+ typedef int Bar;
+
+ template
+ struct N {};
+
+ typedef Bar type1;
+ typedef A::Bar type2;
+ typedef A::Bar type3;
+ typedef A::Bar type4; // { dg-error "" }
+ typedef typename A::Bar type5;
+
+ typedef N type6;
+ typedef A::N type7;
+ typedef A::N type8;
+ typedef A::template N type9; // { dg-error "" }
+ typedef typename A::template N type10;
+
+ typedef D Bar2;
+ struct N2 { typedef int K; };
+
+ // Check that A::N2 is still considered dependent (because it
+ // could be specialized), while A::Bar2 (being just ::D) is not.
+ typedef A::Bar2 type11;
+ typedef type11::K k3;
+
+ typedef A::N2 type12;
+ typedef typename type12::K k2;
+ typedef type12::K k1; // { dg-error "" }
+
+ // Check that A::Bar2 is not considered dependent even if we use
+ // the typename keyword.
+ typedef typename A::Bar2 type13;
+ typedef type13::K k4;
+};
dependent-name5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pseudodtor2.C
===================================================================
--- pseudodtor2.C (nonexistent)
+++ pseudodtor2.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/32384
+// { dg-do compile }
+
+template struct D
+{
+ typedef int T;
+ S foo ();
+
+ D () { foo ().~T(); } // { dg-error "is not of type" }
+};
+
+struct Z
+{
+ Z () {}
+ ~Z () {}
+};
+
+D d;
pseudodtor2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23510.C
===================================================================
--- pr23510.C (nonexistent)
+++ pr23510.C (revision 338)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-ftemplate-depth-15" }
+template
+struct Factorial
+{
+ enum { nValue = nFactor * Factorial::nValue }; // { dg-error "depth exceeds maximum" }
+ // { dg-message "skipping 5 instantiation contexts" "" { target *-*-* } 6 }
+ // { dg-error "incomplete type" "" { target *-*-* } 6 }
+}
+
+ template<> // { dg-error "expected" }
+ struct Factorial<0>
+ {
+ enum { nValue = 1 };
+ }
+
+ static const unsigned int FACTOR = 20;
+
+int main()
+{
+ Factorial::nValue;
+ return 0;
+}
pr23510.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash84.C
===================================================================
--- crash84.C (nonexistent)
+++ crash84.C (revision 338)
@@ -0,0 +1,19 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/35405
+// { dg-do compile }
+
+template struct a
+{
+ template class C, typename X, C* =0>
+ struct b // { dg-error "class C' is not a template|is not a valid type" }
+ {
+ };
+};
+
+void
+foo ()
+{
+ a v; // { dg-message "instantiated from here" }
+}
+
+
crash84.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: func1.C
===================================================================
--- func1.C (nonexistent)
+++ func1.C (revision 338)
@@ -0,0 +1,13 @@
+template
+inline void f(const T1&,const T2&) { }
+
+template
+struct A {
+ template void g(T& i) { }
+};
+
+int main() {
+ int i;
+ A a;
+ a.g(i);
+}
func1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash67.C
===================================================================
--- crash67.C (nonexistent)
+++ crash67.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/32561
+
+template struct A; // { dg-error "redefinition|declared" }
crash67.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-3.C
===================================================================
--- canon-type-3.C (nonexistent)
+++ canon-type-3.C (revision 338)
@@ -0,0 +1,20 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+template struct A ;
+template > struct B { } ;
+template struct D
+{
+ typedef W X ;
+ typedef X (FP) ();
+ A a ;
+} ;
+
+template < class Y > struct E
+{
+ typedef Y (FP) ();
+ B b ;
+} ;
+E < int > e ;
+
canon-type-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static7.C
===================================================================
--- static7.C (nonexistent)
+++ static7.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/17530
+// { dg-do link }
+
+typedef void (*Func) ();
+void f (Func) {}
+struct B
+{
+ static void staticfunc () {}
+};
+template
+void C(){ f (B::staticfunc); }
+int main ()
+{
+ C<0>();
+ return 0;
+}
static7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local4.C
===================================================================
--- local4.C (nonexistent)
+++ local4.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/17413
+
+template void foo() {}
+
+int main () {
+ struct S {};
+ foo (); // { dg-error "match" }
+}
local4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mem_func_ptr.C
===================================================================
--- mem_func_ptr.C (nonexistent)
+++ mem_func_ptr.C (revision 338)
@@ -0,0 +1,57 @@
+// { dg-do compile }
+template struct takes_member_ptr;
+template struct takes_member_ptr {};
+
+template
+void fun_takes_member_ptr(T Klasse::*) {}
+
+
+template struct order_member_ptrs;
+template struct order_member_ptrs {};
+template
+ struct order_member_ptrs
+ {
+ typedef int type;
+ };
+
+template
+ struct order_member_ptrs
+ {
+ typedef int c_type;
+ };
+
+template
+ struct order_member_ptrs
+ {
+ typedef int v_type;
+ };
+
+template
+ struct order_member_ptrs
+ {
+ typedef int cv_type;
+ };
+
+
+struct X {
+ void bar(float) {}
+ void bar_c(float) const {}
+ void bar_v(float) volatile {}
+ void bar_cv(float) const volatile {}
+};
+
+void foo()
+{
+ sizeof(takes_member_ptr);
+ sizeof(takes_member_ptr);
+ sizeof(takes_member_ptr);
+ sizeof(takes_member_ptr);
+ sizeof(order_member_ptrs::type);
+ sizeof(order_member_ptrs::c_type);
+ sizeof(order_member_ptrs::v_type);
+ sizeof(order_member_ptrs::cv_type);
+ fun_takes_member_ptr(&X::bar);
+ fun_takes_member_ptr(&X::bar_c);
+ fun_takes_member_ptr(&X::bar_v);
+ fun_takes_member_ptr(&X::bar_cv);
+}
mem_func_ptr.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef1.C
===================================================================
--- typedef1.C (nonexistent)
+++ typedef1.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Dec 2001
+
+// PR 72
+
+template struct A
+{
+ typedef T type;
+};
+
+template struct B
+{
+ typedef int xxx; // { dg-error "" }
+ typedef T xxx; // { dg-error "" }
+ typedef typename A::type xxx; // { dg-error "" }
+ typedef A::type xxx; // { dg-error "" }
+};
+
+B good;
typedef1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae6_neg.C
===================================================================
--- sfinae6_neg.C (nonexistent)
+++ sfinae6_neg.C (revision 338)
@@ -0,0 +1,58 @@
+// DR 339
+//
+// Test of the use of the function call operator with SFINAE
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+
+template struct type { };
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+template
+ typename enable_if()(create_a(), create_a()), 1),
+ yes_type>::type
+ check_is_callable2(type, type, type);
+
+no_type check_is_callable2(...);
+
+template
+struct is_callable2
+{
+ static const bool value =
+ (sizeof(check_is_callable2(type(), type(), type()))
+ == sizeof(yes_type)); // { dg-error "within this context" }
+};
+
+#define JOIN( X, Y ) DO_JOIN( X, Y )
+#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
+#define DO_JOIN2( X, Y ) X##Y
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
+#else
+# define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
+#endif
+
+
+struct A;
+struct B;
+
+struct A {
+ A(B);
+};
+
+struct B {
+ B(A);
+};
+
+struct F {
+ void operator()(A, A);
+
+private:
+ void operator()(B, B); // { dg-error "is private" }
+};
+
+STATIC_ASSERT((is_callable2::value));
sfinae6_neg.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: class3.C
===================================================================
--- class3.C (nonexistent)
+++ class3.C (revision 338)
@@ -0,0 +1,2 @@
+// PR c++/25634
+template template struct A; // { dg-error "too many" }
class3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor1.C
===================================================================
--- dtor1.C (nonexistent)
+++ dtor1.C (revision 338)
@@ -0,0 +1,8 @@
+struct A {};
+
+template struct B
+{
+ B() { A().A::~A(); }
+};
+
+B b;
dtor1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mem-partial1.C
===================================================================
--- mem-partial1.C (nonexistent)
+++ mem-partial1.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/14032
+
+template struct outer {
+ template
+ struct inner {
+ static int f() { return inner::N; };
+ };
+
+ template
+ struct inner {
+ static const int N = 1;
+ };
+};
+
+int i = outer::inner::f();
mem-partial1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-type1.C
===================================================================
--- non-type1.C (nonexistent)
+++ non-type1.C (revision 338)
@@ -0,0 +1,49 @@
+// PR c++/4377
+
+template < int I1, int I2 >
+class unit
+{
+public:
+ typedef unit my_type;
+
+ unit() {}
+ unit( const unit& ) {}
+
+ template< int Q1, int Q2 >
+ unit< I1 + Q1, I2 + Q2 > operator * ( const unit< Q1, Q2 >& rhs ) const {
+ return unit< I1 + Q1, I2 + Q2 >();
+ }
+
+ template< int Q1, int Q2 >
+ unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const {
+ return unit< I1 - Q1, I2 - Q2 >();
+ }
+};
+
+// specialization added to first test
+//
+template <>
+class unit<0,0> {
+public:
+ typedef unit<0,0> my_type;
+
+ unit() {}
+
+ friend unit<0,0> operator*( const unit<0,0>& lhs, const unit<0,0>& rhs ) {
+ return unit<0,0>();
+ }
+ friend unit<0,0> operator/( const unit<0,0>& lhs, const unit<0,0>& rhs ) {
+ return unit<0,0>();
+ }
+
+};
+
+
+int main()
+{
+ const unit<1,0> u1;
+ const unit<2,0> u2;
+
+ unit<-1,0> u3( u1 / u2 );
+ unit< 3,0> u4( u1 * u2 );
+}
non-type1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg12.C
===================================================================
--- defarg12.C (nonexistent)
+++ defarg12.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/35828
+// { dg-options "-std=c++0x" }
+
+template < typename > struct A ;
+template < template < typename > class = A >
+void test ()
+{
+ test ();
+}
+
defarg12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor4.C
===================================================================
--- ctor4.C (nonexistent)
+++ ctor4.C (revision 338)
@@ -0,0 +1,39 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jun 2004
+
+// Origin Rani Sharoni via giovannibajo@libero.it
+// Bug 16174, SFINAE failure.
+
+template struct K
+{
+ K();
+
+ K(K & rhs);
+ K(K const& rhs);
+ template K(K const& rhs);
+
+private:
+ template struct A;
+ template struct A< K const>
+ { typedef typename K::compile_time_error type; };
+
+ // This is used to reject calls to the copy constructor
+ // with objects which are top-level const. If they are
+ // const, the specialization of A is instantiated and
+ // causes a compile time error. Otherwise, the general
+ // template is picked up, it misses definition, so this
+ // ctor declaration is rejected by SFINAE and everybody
+ // is happy.
+ // GCC 3.4.1pre and 3.5.0 always matches A's specialization
+ // when instantiating from foo(), and this causes the error.
+ template
+ K(U& rhs, typename A::type = 0);
+};
+
+
+K foo(void)
+{
+ return K();
+}
ctor4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call3.C
===================================================================
--- call3.C (nonexistent)
+++ call3.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/18436
+
+void foo(int);
+
+struct A
+{
+ static void foo(A);
+};
+
+template struct B : T
+{
+ B() { foo(T()); } // { dg-error "cannot convert" }
+};
+
+B b;
call3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static19.C
===================================================================
--- static19.C (nonexistent)
+++ static19.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/24275
+
+template struct bool_var {
+ static const bool value = val;
+};
+namespace is_inc_ {
+ struct any {
+ template any(T const&);
+ };
+ int operator++(any const&);
+ template struct impl {
+ static T &x;
+ static const bool value = sizeof(++x) == 1;
+ };
+}
+template struct is_incr : bool_var< is_inc_::impl::value> {};
+struct not_incr{};
+typedef int sa1[ is_incr::value ? -1 : 1];
static19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype14.C
===================================================================
--- nontype14.C (nonexistent)
+++ nontype14.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/23789
+
+template struct X {
+ template
+ X< (W+(W&&W) > 1 ? W+(W&&W) : 1)+1>
+ operator + (const X&) const;
+};
+
+template void foo()
+{
+ X<6> A,B;
+ A + B;
+}
nontype14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig6.C
===================================================================
--- koenig6.C (nonexistent)
+++ koenig6.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/38850
+
+template
+class Vector2 {
+ private:
+ VType c_[2];
+ public:
+ typedef Vector2 Self;
+
+ Vector2(const VType x, const VType y) {
+ c_[0] = x;
+ c_[1] = y;
+ }
+
+ friend inline Self Max(const Self &v1, const Self &v2) {
+ return Self(v1.c_[0], v1.c_[1]);
+ }
+};
+
+template
+Vector2 foo(T x) {
+ Vector2 y(0,0);
+ return Max(y, y);
+}
+
+int main() {
+ foo(3);
+ return 0;
+}
koenig6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec36.C
===================================================================
--- spec36.C (nonexistent)
+++ spec36.C (revision 338)
@@ -0,0 +1,16 @@
+/* PR c++/38089 */
+/* { dg-do "compile" } */
+
+struct basic_string
+{
+ basic_string(const int __s);
+};
+namespace MyNS {
+ class MyClass {
+ template
+ T test() { } /* { dg-error "from definition" } */
+ };
+}
+template <>
+basic_string MyNS::MyClass::test() /* { dg-error "specialization of" } */
+{ return 1; }
spec36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error28.C
===================================================================
--- error28.C (nonexistent)
+++ error28.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/27211
+
+struct A {};
+
+template void A::foo(); // { dg-error "member function" }
error28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec19.C
===================================================================
--- spec19.C (nonexistent)
+++ spec19.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/18962
+
+template
+class Klasse
+{
+public:
+ template
+ void function( const Klasse& );
+};
+
+template<>
+template
+void Klasse::function( const Klasse& param )
+{
+ param; // make sure we use the argument list from the definition.
+}
+
+int main()
+{
+ Klasse instance;
+ Klasse param;
+ instance.function( param );
+}
spec19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp19.C
===================================================================
--- qualttp19.C (nonexistent)
+++ qualttp19.C (revision 338)
@@ -0,0 +1,41 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2001
+
+// PR 2645
+
+template
+struct call_traits
+{
+ public:
+ typedef T type_less_spec;
+};
+
+template
+struct call_traits
+{
+ typedef T type_more_spec;
+};
+
+
+int main()
+{
+ int num;
+
+ // Two typedefs lead to the instant. of the less spec. ("wrong") template
+ typedef int& r_type;
+ typedef const r_type cr_type;
+ call_traits::type_less_spec var = num; // { dg-error "" "" }
+
+ // The explicit type leads to the instantiation of the "correct" one
+ call_traits::type_more_spec var2 = num;
+
+ // As happen with a single typedef!
+ typedef const int& std_cr_type;
+ call_traits::type_more_spec var3 = num;
+
+
+ // As happen, indeed, without the cv-qualifier
+ call_traits::type_more_spec var4;
+}
qualttp19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate2.C
===================================================================
--- instantiate2.C (nonexistent)
+++ instantiate2.C (revision 338)
@@ -0,0 +1,8 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+
+// PR c++/2862
+// Default function argument and template instantiation.
+
+template void f (int=0) {}
+template void f<1> (); // { dg-error "not match" }
instantiate2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp20.C
===================================================================
--- ttp20.C (nonexistent)
+++ ttp20.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/27424
+// Bug: failing to substitute the 'int' into C
+
+template struct A
+{
+ template class> struct B {};
+ template struct C;
+ B b;
+};
+
+A a;
ttp20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg1.C
===================================================================
--- defarg1.C (nonexistent)
+++ defarg1.C (revision 338)
@@ -0,0 +1,7 @@
+struct Outer {
+ template struct Inner {};
+};
+
+void f() {
+ Outer::Inner<2> i;
+}
defarg1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem16.C
===================================================================
--- ptrmem16.C (nonexistent)
+++ ptrmem16.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/25369
+// { dg-do link }
+
+template struct A
+{
+ void foo() {}
+};
+
+void bar(void (A::*)()) {}
+
+template void baz()
+{
+ bar(&A::foo);
+}
+
+int main()
+{
+ baz<0>();
+ return 0;
+}
ptrmem16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using7.C
===================================================================
--- using7.C (nonexistent)
+++ using7.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Aug 2003
+
+// PR 9447. Using decls in reopened template classes.
+
+template struct A { int i; };
+
+template struct B : public A
+{
+ using A::i;
+ int foo() const;
+};
+
+struct C {};
+
+template int B::foo() const
+{
+ return i;
+}
using7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash93.C
===================================================================
--- crash93.C (nonexistent)
+++ crash93.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/40371
+
+struct A
+{
+ typedef void (&F)();
+ template operator F();
+};
+
+void foo()
+{
+ A()(); // { dg-error "no match" }
+}
crash93.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash76.C
===================================================================
--- crash76.C (nonexistent)
+++ crash76.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/34486
+
+template struct A
+{
+ typedef A* X;
+};
+
+template struct B
+{
+ using A::X::Y; // { dg-error "not a base type" }
+};
+
+B b;
crash76.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial2.C
===================================================================
--- partial2.C (nonexistent)
+++ partial2.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: lorgon1@yahoo.com
+
+// PR c++/11154: Multi-level template argument in partial ordering of
+// class template
+
+template struct Outer {
+ template struct Foo {};
+ template struct Foo {};
+ template struct Foo {};
+};
+
+Outer::Foo f;
partial2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash59.C
===================================================================
--- crash59.C (nonexistent)
+++ crash59.C (revision 338)
@@ -0,0 +1,19 @@
+//PR c++/27329
+
+template struct A // { dg-error "forward declaration" }
+! // { dg-error "expected unqualified-id" }
+ ;
+
+template struct A { int foo(); }; // { dg-error "not a template" }
+
+int i = A<0>().foo(); // { dg-error "not a template|invalid use" }
+
+
+template struct B
+! // { dg-error "expected unqualified-id" }
+ ;
+
+template struct B { static int bar(); }; // { dg-error "not a template" }
+
+int j = B<0>::bar(); // { dg-error "not a template|incomplete type" }
+
crash59.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent1.C
===================================================================
--- non-dependent1.C (nonexistent)
+++ non-dependent1.C (revision 338)
@@ -0,0 +1,21 @@
+//PR c++/8222
+// Origin: giovannibajo@libero.it and setzersn@gmx.de
+
+// { dg-do run }
+
+struct Foo
+{
+ template
+ void func() {}
+};
+template
+void Bar(Foo* p)
+{
+ p->func();
+}
+
+int main()
+{
+ Foo c;
+ Bar(&c);
+}
non-dependent1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualified-id3.C
===================================================================
--- qualified-id3.C (nonexistent)
+++ qualified-id3.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/44587
+
+template struct A { };
+template struct B {
+ static const int c;
+ typedef A::c> C; // { dg-error "non-constant" }
+};
+template const int B::c = sizeof (T);
+
+template struct D { };
+template struct E {
+ static const int c = sizeof (T);
+ typedef D::c> F; // OK
+};
qualified-id3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype5.C
===================================================================
--- nontype5.C (nonexistent)
+++ nontype5.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+// Volker Reichelt
+
+// PR c++/13797: ICE invalid nontype template parameter
+
+template struct A
+{
+ typedef A<0> B;
+ template struct C {}; // { dg-error "not a valid type" }
+};
+
+A<0> a;
nontype5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error9.C
===================================================================
--- error9.C (nonexistent)
+++ error9.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/10926
+
+struct Foo
+{
+ template
+ ~Foo(); // { dg-error "" }
+};
error9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash2.C
===================================================================
--- crash2.C (nonexistent)
+++ crash2.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-options "" }
+
+template
+class A
+{
+public:
+ static const EnumType size = max; // { dg-error "" }
+ int table[size]; // { dg-error "constant" }
+};
+template
+const EnumType A::size;
+
+
+namespace N
+{
+enum E { max = 5 };
+
+struct B
+{
+ A a;
+};
+
+}
+
+int
+main()
+{
+ N::B b;
+
+ return 0;
+}
crash2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp9.C
===================================================================
--- qualttp9.C (nonexistent)
+++ qualttp9.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template class TT> class C {
+};
+
+template struct D : T {
+ C c;
+};
+
+struct E {
+ protected:
+ template class B {};
+};
+
+D d;
qualttp9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec9.C
===================================================================
--- spec9.C (nonexistent)
+++ spec9.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Lynn Akers
+// Wolfgang Bangerth
+
+// PR c++/10956: Incorrect template substitution for member template
+// specialization inside template class.
+
+template struct C {
+ template void pre_add(T);
+};
+
+template<>
+template
+void C<32>::pre_add(T) {
+ T pre;
+}
+
+int main() {
+ C<32>().pre_add(1);
+}
spec9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename12.C
===================================================================
--- typename12.C (nonexistent)
+++ typename12.C (revision 338)
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Jul 2007
+
+// Origin: sschunck@pdf.de
+// PR 30818, failure to resolve typename typedef
+
+template < typename T >
+class A
+{
+ typedef int type;
+ class B;
+};
+
+template < typename T >
+class A::B
+{
+ typedef typename A::type type;
+ type f();
+};
+
+template < typename T >
+typename A::B::type
+A::B::f() { return 0; }
typename12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass3.C
===================================================================
--- memclass3.C (nonexistent)
+++ memclass3.C (revision 338)
@@ -0,0 +1,39 @@
+// PR c++/17132
+
+template
+struct has_deref
+{
+ struct impl
+ {
+ template <
+ typename Type,
+ typename Type::reference (Type::*Func)(void) const>
+ struct func_tag;
+
+ template
+ static char (& test(
+ Type *,
+ func_tag * = 0
+ ))[2];
+ static char test(void *);
+ };
+
+ static const bool value = (sizeof(impl::test((T *) 0)) == 2);
+};
+
+template
+struct container
+{
+ struct iterator
+ {
+ typedef T & reference;
+ reference operator*() const;
+ };
+};
+
+int main()
+{
+ typedef container::iterator iter;
+ int result = has_deref::value;
+ return result;
+}
memclass3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof8.C
===================================================================
--- sizeof8.C (nonexistent)
+++ sizeof8.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-do compile }
+// Testcase by: bangerth@dealii.org
+// PR c++/11406: ICE
+
+template struct S{};
+
+template S f() {}
+
+template S f<2>();
sizeof8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: void9.C
===================================================================
--- void9.C (nonexistent)
+++ void9.C (revision 338)
@@ -0,0 +1,4 @@
+//PR c++/28738
+
+template struct A {}; // { dg-error "not a valid type" }
+template struct A {}; // { dg-error "not a valid type" }
void9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend5.C
===================================================================
--- memfriend5.C (nonexistent)
+++ memfriend5.C (revision 338)
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member template function of member class template as friend
+
+template struct A {
+ template struct B {
+ template void f(V);
+ };
+};
+
+class X {
+ int i;
+ template template template
+ friend void A::B::f(V);
+};
+
+template template template
+ void A::B::f(V)
+{
+ X x;
+ x.i = 0;
+}
+
+int main()
+{
+ A::B a1;
+ a1.f(0);
+}
memfriend5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend5.C
===================================================================
--- friend5.C (nonexistent)
+++ friend5.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+namespace NS { template class C; }
+
+template class X {
+ template friend class NS::C;
+};
+
+template class X;
friend5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array2-1.C
===================================================================
--- array2-1.C (nonexistent)
+++ array2-1.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2003
+
+// PR c++/13494. ICE
+
+template
+int foo(int d[][4])
+{
+ return d[0][0];
+}
+
array2-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup6.C
===================================================================
--- lookup6.C (nonexistent)
+++ lookup6.C (revision 338)
@@ -0,0 +1,11 @@
+struct S
+{
+ template static void g();
+};
+
+template
+void f() { return S::template g(); }
+
+void g() {
+ f();
+}
lookup6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp8.C
===================================================================
--- ttp8.C (nonexistent)
+++ ttp8.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// Contributed by: Niall Douglas
+// PR c++/14284: Failure to select specialization
+
+template struct S;
+template class> struct I {};
+
+template struct Match;
+
+template class C>
+struct Match, 0> {};
+
+template class C, int i>
+struct Match, i>;
+
+Match, 0> v;
ttp8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: alignof1.C
===================================================================
--- alignof1.C (nonexistent)
+++ alignof1.C (revision 338)
@@ -0,0 +1,13 @@
+template
+int my_alignof()
+{
+ return __alignof__(T);
+}
+
+template
+struct X { };
+
+int main()
+{
+ return my_alignof >();
+}
alignof1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static28.C
===================================================================
--- static28.C (nonexistent)
+++ static28.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/29518
+
+template< bool C > int assertion_failed( int);
+template< class >
+struct N
+{
+ static bool const okay = true;
+ enum {
+ t = sizeof( assertion_failed( 0))
+ };
+};
+int main()
+{
+ N n;
+}
static28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested1.C
===================================================================
--- nested1.C (nonexistent)
+++ nested1.C (revision 338)
@@ -0,0 +1,15 @@
+/* PR c++/4633 */
+/* { dg-do compile } */
+
+// The 'class X' inside the template used to escape (somehow),
+// so that the typedef claimed that it was redefining X.
+
+template struct S ;
+
+template <> struct S
+{
+ template struct R;
+ template struct R { };
+
+ typedef int X;
+};
nested1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error37.C
===================================================================
--- error37.C (nonexistent)
+++ error37.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// PR C++/29388
+// We used to ICE in is_ancestor because we would use int as the context of foo
+// but that is invalid.
+
+template struct A
+{
+ typedef int T;
+ void foo();
+};
+
+template void A::T::foo() {} // { dg-error "" }
error37.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec28.C
===================================================================
--- spec28.C (nonexistent)
+++ spec28.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/25854
+// Bad diagnostic
+// { dg-do compile }
+
+template struct A {}; // { dg-error "provided" }
+template<> struct A<> {}; // { dg-error "wrong number" }
spec28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array9.C
===================================================================
--- array9.C (nonexistent)
+++ array9.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/18429
+
+int subtrees = 4;
+template< class T >
+struct Tree {
+ Tree* L[subtrees]; // { dg-error "" }
+ Tree* R[subtrees]; // { dg-error "" }
+ ~Tree()
+ {
+ delete [] L[0]; // { dg-error "" }
+ delete [] R[0]; // { dg-error "" }
+ }
+};
+
+void f()
+{
+ Tree t;
+}
array9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: debug1.C
===================================================================
--- debug1.C (nonexistent)
+++ debug1.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/40274
+// { dg-options "-g" }
+
+template struct valuelist_types
+{
+ struct null { };
+ template struct list { };
+};
+
+template void foo()
+{
+ typename valuelist_types::template list v;
+}
+
+void bar()
+{
+ valuelist_types::list<2> v;
+}
debug1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial-specialization.C
===================================================================
--- partial-specialization.C (nonexistent)
+++ partial-specialization.C (revision 338)
@@ -0,0 +1,22 @@
+// Contributed by Gabriel Dos Reis
+// Origin: philippeb@videotron.ca
+// { dg-do compile }
+
+struct B
+{
+ int i;
+};
+
+template
+ struct A;
+
+template
+ struct A<_T, int, _V>
+ {
+ };
+
+int main()
+{
+ A a;
+}
+
partial-specialization.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-name6.C
===================================================================
--- dependent-name6.C (nonexistent)
+++ dependent-name6.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/26261
+// { dg-final { scan-assembler "_ZN1YIiE1fIiEE1XILi1EEv" } }
+
+template class X {};
+
+template struct Y {
+ static const unsigned int dim = 1;
+ template X::dim> f();
+};
+
+template template
+X::dim> Y::f() { return X(); }
+
+int main()
+{
+ Y().f();
+}
dependent-name6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp12.C
===================================================================
--- ttp12.C (nonexistent)
+++ ttp12.C (revision 338)
@@ -0,0 +1,19 @@
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+// Check the type of non-type parameter in template template parameter
+// only if it is dependent.
+
+template class T>
+struct X {};
+
+template class T>
+struct Y {
+ X x;
+};
+
+template struct Z {};
+
+Y y1;
+Y y2; // { dg-error "mismatch|expected|invalid" }
ttp12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pseudodtor3.C
===================================================================
--- pseudodtor3.C (nonexistent)
+++ pseudodtor3.C (revision 338)
@@ -0,0 +1,43 @@
+// PR c++/32241
+// { dg-do compile }
+
+struct A
+{
+ typedef int T;
+ T &foo ();
+ A () { foo.~T (); } // { dg-error "does not have class type|expected" }
+};
+
+template struct B
+{
+ T &foo ();
+ B () { foo.~T (); } // { dg-error "invalid use of member" }
+};
+
+B b;
+
+template struct C
+{
+ T t;
+ C () { t.~S (); } // { dg-error "is not of type" }
+};
+
+C c;
+
+template struct D
+{
+ T t;
+ typedef long int U;
+ D () { t.~U (); } // { dg-error "is not of type" }
+};
+
+D d;
+
+template struct E
+{
+ T &foo ();
+ typedef long int U;
+ E () { foo.~U (); } // { dg-error "is not of type" }
+};
+
+E e;
pseudodtor3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: func2.C
===================================================================
--- func2.C (nonexistent)
+++ func2.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+typedef void (*fptr)();
+fptr zeroptr = 0;
+template struct foo { };
+template struct foo { };
+// { dg-error "not a valid template argument" "not valid" { target *-*-* } 6 }
+// { dg-error "must be the address" "must be the address " { target *-*-* } 6 }
+
+// The rest is needed to trigger the ICE in 4.0 to 4.3:
+void f() { }
+foo m_foo;
func2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash85.C
===================================================================
--- crash85.C (nonexistent)
+++ crash85.C (revision 338)
@@ -0,0 +1,15 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/37142
+// { dg-do compile }
+
+template class W> struct A {};
+
+template struct B {};
+
+int
+main ()
+{
+ A a;
+ return 0;
+}
+
crash85.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-4.C
===================================================================
--- canon-type-4.C (nonexistent)
+++ canon-type-4.C (revision 338)
@@ -0,0 +1,22 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+template struct A ;
+template > struct B { } ;
+
+template
+struct D
+{
+ typedef W X;
+ A a;
+} ;
+
+template
+struct E
+{
+ B b;
+};
+
+E < int > e;
+
canon-type-4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash68.C
===================================================================
--- crash68.C (nonexistent)
+++ crash68.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/33035
+
+template
+struct a {
+ template
+ struct b {
+ template
+ void f()
+ {
+ struct g
+ {
+ ~g() {}
+ };
+ }
+ };
+};
crash68.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local5.C
===================================================================
--- local5.C (nonexistent)
+++ local5.C (revision 338)
@@ -0,0 +1,12 @@
+struct Attribute { };
+
+template bool operator == (const Attribute &attr, const T &value);
+
+enum {
+ anon = 123
+};
+
+void test(int foo)
+{
+ if (foo == anon) ; /* { dg-bogus "anonymous type" } */
+}
local5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static8.C
===================================================================
--- static8.C (nonexistent)
+++ static8.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/17585
+
+template struct S03 {};
+class C03 {
+public:
+ static void f(void) {}
+ void g(void) { S03<&f> s03; }
+};
static8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef2.C
===================================================================
--- typedef2.C (nonexistent)
+++ typedef2.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/18155
+
+template typedef struct A; // { dg-warning "'typedef' was ignored" }
+ // { dg-error "" "" { target *-*-* } 3 }
typedef2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mem-partial2.C
===================================================================
--- mem-partial2.C (nonexistent)
+++ mem-partial2.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/14032
+// { dg-do run }
+
+template
+struct outer
+{
+ template
+ struct inner // unspecialized compare != compare_with
+ {
+ static inline bool test()
+ {
+ return false;
+ }
+ };
+ template // specialization compare == compare_with
+ struct inner
+ {
+ static inline bool test()
+ {
+ return true;
+ }
+ };
+};
+int main ()
+{
+ bool b = outer::inner::test();
+
+ return b != true;
+}
mem-partial2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor2.C
===================================================================
--- dtor2.C (nonexistent)
+++ dtor2.C (revision 338)
@@ -0,0 +1,10 @@
+struct Foo
+{
+ template
+ ~Foo() {} // { dg-error "" }
+};
+
+int main()
+{
+ Foo f;
+}
dtor2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor5.C
===================================================================
--- ctor5.C (nonexistent)
+++ ctor5.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/24278
+
+template struct A
+{
+ A() : T(0) {} // { dg-error "base" }
+};
+
+A a; // { dg-message "instantiated" }
ctor5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg13.C
===================================================================
--- defarg13.C (nonexistent)
+++ defarg13.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/14912
+// Bug: We were instantiating A in order to compare it to the matching
+// argument for C, which fails.
+
+template
+struct A
+{
+ typedef typename T::F F;
+};
+
+struct B { };
+
+template ::F >
+struct C
+{
+ typename T::F f; // { dg-error "no type" }
+};
+
+C c; // { dg-message "instantiated" }
defarg13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent10.C
===================================================================
--- non-dependent10.C (nonexistent)
+++ non-dependent10.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// Two-phase name lookup for address of member:
+// Detecting overloading function error during parsing
+
+struct S
+{
+ int f(char);
+ int f(int);
+};
+
+template
+struct X
+{};
+
+template
+struct Foo
+{
+ X<&S::f> x; // { dg-error "convert|no type" }
+};
non-dependent10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call4.C
===================================================================
--- call4.C (nonexistent)
+++ call4.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/25364
+
+class OFX_PropertySuiteV1
+{
+ static int propGetDouble ();
+};
+template
+struct OFX_AnimatedNumberParam
+{
+ virtual int paramSetValueAtTime()
+ {
+ return PROPGET();
+ }
+};
+void f()
+{
+ new OFX_AnimatedNumberParam<2,double,OFX_PropertySuiteV1::propGetDouble>();
+}
call4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-type-template-argument-1.C
===================================================================
--- non-type-template-argument-1.C (nonexistent)
+++ non-type-template-argument-1.C (revision 338)
@@ -0,0 +1,12 @@
+struct A { static const bool b=false; };
+
+struct B { typedef A X; };
+
+template struct C {};
+
+template struct D
+{
+ C c; // { dg-error "parsed as a non-type|if a type is meant" }
+};
+
+D d; // { dg-message "instantiated from here" }
non-type-template-argument-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash10.C
===================================================================
--- crash10.C (nonexistent)
+++ crash10.C (revision 338)
@@ -0,0 +1,27 @@
+//Origin: benko@sztaki.hu
+//PR c++/11432
+// The mainline ICE on this one between 2003-01-16 and 2003-07-29.
+
+// { dg-do compile }
+
+ extern "C" void abort();
+
+
+template
+struct a
+{
+ static int const value = A - 1;
+};
+
+
+template
+struct b
+{
+ static int foo()
+ {
+ return a::value;
+ }
+
+
+ static int const L = a::value;
+};
crash10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype15.C
===================================================================
--- nontype15.C (nonexistent)
+++ nontype15.C (revision 338)
@@ -0,0 +1,20 @@
+struct foo {
+ typedef int (*fun)(int);
+
+ static int f(int); // overload between static & non-static
+ int f();
+
+ static int g(int); // non-overloaded static
+};
+
+template
+struct f_obj {
+ // something ..
+};
+
+int foo::f() {
+ f_obj f1;
+ f_obj f2;
+
+ return 0;
+}
nontype15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit1.C
===================================================================
--- explicit1.C (nonexistent)
+++ explicit1.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do link }
+// { dg-options "-fno-implicit-templates" }
+
+template struct C {
+ ~C();
+};
+template C::~C() {}
+
+struct X {
+ C *p;
+ ~X() { delete p; }
+};
+
+template class C;
+C x;
+
+int main () {}
explicit1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig7.C
===================================================================
--- koenig7.C (nonexistent)
+++ koenig7.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/13549
+// We need to do arg-dep lookup for g(j) at instantiation time because
+// g is dependent, even though (j) is not; at that point we can find
+// g(h).
+
+template int g(int);
+class h{};
+template int l(){h j; return g(j);}
+template int g(const h&);
+class j{};
+int jj(){return l();}
koenig7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error29.C
===================================================================
--- error29.C (nonexistent)
+++ error29.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/33209
+
+template void foo(int, T::x); // { dg-error "T::x" }
+
+template class T> void foo2(int, T::x); // { dg-error "T::x" }
error29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec37.C
===================================================================
--- spec37.C (nonexistent)
+++ spec37.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/28300
+
+template struct A
+{
+ template struct A; // { dg-error "namespace scope" }
+};
spec37.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate3.C
===================================================================
--- instantiate3.C (nonexistent)
+++ instantiate3.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// Origin: Scott Snyder
+
+// PR c++/7639
+// ICE when accessing member with incomplete type.
+
+class ACE_Null_Mutex; // { dg-error "forward declaration" }
+
+template
+struct ACE_Cleanup_Adapter
+{
+ TYPE &object ()
+ { return object_; } // { dg-error "invalid" }
+ TYPE object_; // { dg-error "incomplete type" }
+};
+
+template class ACE_Cleanup_Adapter; // { dg-message "instantiated from here" }
instantiate3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend10.C
===================================================================
--- memfriend10.C (nonexistent)
+++ memfriend10.C (revision 338)
@@ -0,0 +1,71 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class template of class template as friend
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+class C {
+ int i;
+ template template friend struct A::B;
+};
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template <> struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A::B b1;
+ b1.f();
+ A::B b2;
+ b2.f();
+ A::B b3;
+ b3.f();
+ A::B b4;
+ b4.f();
+}
memfriend10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg2.C
===================================================================
--- defarg2.C (nonexistent)
+++ defarg2.C (revision 338)
@@ -0,0 +1,10 @@
+struct X {
+ X ();
+};
+
+template struct O {
+ struct I {
+ I (const X & = X());
+ };
+};
+template struct O<2>;
defarg2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp21.C
===================================================================
--- ttp21.C (nonexistent)
+++ ttp21.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/28853
+// { dg-do compile }
+
+template class A>
+int A<0>::i; // { dg-error "template template parameter" }
ttp21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem17.C
===================================================================
--- ptrmem17.C (nonexistent)
+++ ptrmem17.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/28346
+
+template struct A
+{
+ int& i;
+ A();
+ ~A() { &A::i; } // { dg-error "reference" }
+};
+
+A<0> a; // { dg-message "instantiated" }
ptrmem17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using8.C
===================================================================
--- using8.C (nonexistent)
+++ using8.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Sergey Shandar
+
+// PR c++/9810: Access checking for member function template
+// appeared in using declaration.
+
+struct A
+{
+ template void F(R) {}
+};
+
+struct B: private A
+{
+ using A::F;
+};
+
+int main()
+{
+ B b;
+ b.F(3);
+}
using8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash77.C
===================================================================
--- crash77.C (nonexistent)
+++ crash77.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/34603
+
+template struct A; // { dg-error "declaration" }
+
+template A::A( struct A; // { dg-error "definition|expected|incomplete" }
crash77.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array10.C
===================================================================
--- array10.C (nonexistent)
+++ array10.C (revision 338)
@@ -0,0 +1,20 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jan 2005
+
+// PR 19270: ICE
+// Origin: Ralf Wildenhues
+
+template struct Vec {
+ T* data;
+ T& operator[](int i) const;
+};
+
+template inline T& Vec::operator[](int i) const
+{
+ return (&data[0])[i];
+}
+
+inline double foo(Vec v)
+{
+ return v[0];
+}
array10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial3.C
===================================================================
--- partial3.C (nonexistent)
+++ partial3.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Origin: John Maddock
+// PR c++/13997: Error while matching partial specialization of array type
+
+template
+struct is_array;
+
+template
+struct is_array;
+
+template
+struct is_array {};
+
+template struct is_array;
partial3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent2.C
===================================================================
--- non-dependent2.C (nonexistent)
+++ non-dependent2.C (revision 338)
@@ -0,0 +1,16 @@
+//PR c++/11070
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template struct X {
+ template
+ static int* execute(int* x) { return x; }
+};
+
+template void foo() {
+ static bool const same = true;
+ X::execute (0);
+}
+
+template void foo ();
+
non-dependent2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype6.C
===================================================================
--- nontype6.C (nonexistent)
+++ nontype6.C (revision 338)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// Origin:
+// PR c++/13957: Improved error message for type in template (when non-type
+// is expected).
+
+template
+struct A
+{
+ typedef int type;
+};
+
+template
+void func(void)
+{
+ (void)A::type(); // { dg-error "non-type" "non-type" }
+// { dg-message "if a type" "note" { target *-*-* } 15 }
+}
+
+template void func(void); // { dg-message "instantiated from here" }
nontype6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash3.C
===================================================================
--- crash3.C (nonexistent)
+++ crash3.C (revision 338)
@@ -0,0 +1,12 @@
+struct S {
+};
+
+extern S i[];
+
+void g (S*);
+
+template
+void f () {
+ g (&i[2]);
+}
+
crash3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename13.C
===================================================================
--- typename13.C (nonexistent)
+++ typename13.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Jul 2007
+
+template struct A
+{
+ struct B;
+ typedef typename B::type type;
+};
+
+template struct A::B
+{
+ typedef typename A::type type;
+
+ type Foo ();
+};
+
+template
+typename A::B::type
+A::B::Foo ()
+{
+ return 0;
+}
typename13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: string1.C
===================================================================
--- string1.C (nonexistent)
+++ string1.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/28337
+
+template void foo()
+{
+ (0 ? "" : "X") + 1;
+}
+
string1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass4.C
===================================================================
--- memclass4.C (nonexistent)
+++ memclass4.C (revision 338)
@@ -0,0 +1,70 @@
+// Origin: PR c++/42824
+// { dg-do compile }
+
+template
+class int_ {
+};
+
+template
+class Unit {
+public:
+ Unit(const Unit& other) {}
+};
+
+template
+class Quan {
+public:
+ Quan(void) {}
+
+ template
+ Quan(double value, Unit unit) {}
+};
+typedef Quan<0> Scalar;
+
+template
+class hlp {
+public:
+ typedef Quan type;
+};
+
+class Mtrl {
+public:
+ template
+ struct AssoType {
+ typedef typename hlp::type type;
+ };
+};
+
+template
+class Eval {
+public:
+ Eval(const T& object){}
+
+ template
+ void eval() {
+ eval (int_<0>());
+ }
+private:
+ template struct Wrap {};
+
+ template
+ void value(Wrap >) {}
+
+ template
+ void value(Wrap) {}
+
+ template
+ void eval(int_<0>) {
+ typedef typename T::template AssoType::type Type;
+ value(Wrap());
+ }
+};
+
+class Foo {
+public:
+ static void eval(const Mtrl& mtrl) {
+ Eval h(mtrl);
+ h.eval<0> ();
+ }
+};
+
memclass4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sizeof9.C
===================================================================
--- sizeof9.C (nonexistent)
+++ sizeof9.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/21025
+
+template struct X { char x[N]; };
+template X<1 + sizeof(T) - sizeof(T)> F(T const &);
+template struct S { int d() { F(1); } };
+
sizeof9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strlen1.C
===================================================================
--- strlen1.C (nonexistent)
+++ strlen1.C (revision 338)
@@ -0,0 +1,9 @@
+template
+void monk2 (A1) {}
+
+unsigned int strlen (const char*);
+
+void monk ()
+{
+ monk2 (strlen (""));
+}
strlen1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend6.C
===================================================================
--- memfriend6.C (nonexistent)
+++ memfriend6.C (revision 338)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function of class template as friend
+// Erroneous case: mismatch during declaration
+
+template struct A {
+ template void f(U); // { dg-error "candidate" }
+ void g(); // { dg-error "candidate|with" }
+ void h(); // { dg-error "candidate|with" }
+ void i(int); // { dg-error "candidate" }
+};
+
+class C {
+ int ii;
+ template friend void A::f(U); // { dg-error "not match" }
+ template template
+ friend void A::g(); // { dg-error "not match|cannot be overloaded" }
+ template friend int A::h(); // { dg-error "not match|cannot be overloaded" }
+ template friend void A::i(char); // { dg-error "not match" }
+};
memfriend6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend6.C
===================================================================
--- friend6.C (nonexistent)
+++ friend6.C (revision 338)
@@ -0,0 +1,53 @@
+// { dg-do compile }
+
+namespace boost_no_member_template_friends{
+
+template
+class foobar;
+
+template
+class foo
+{
+private:
+ template friend class foobar;
+ template friend class foo;
+ template friend bool must_be_friend_proc(const foo& f);
+ int i;
+public:
+ foo(){ i = 0; }
+ template
+ foo(const foo& f){ i = f.i; }
+};
+
+template
+class foo;
+
+template
+bool must_be_friend_proc(const foo& f);
+
+template
+bool must_be_friend_proc(const foo& f)
+{ return f.i != 0; }
+
+template
+class foobar
+{
+ int i;
+public:
+ template
+ foobar(const foo& f)
+ { i = f.i; }
+};
+
+
+int test()
+{
+ foo fi;
+ foo fd(fi);
+ (void) &fd; // avoid "unused variable" warning
+ foobar fb(fi);
+ (void) &fb; // avoid "unused variable" warning
+ return 0;
+}
+
+}
friend6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vtable1.C
===================================================================
--- vtable1.C (nonexistent)
+++ vtable1.C (revision 338)
@@ -0,0 +1,23 @@
+// Test that vtables are set up properly for constructors and destructors
+// of template classes.
+
+// { dg-do run }
+
+int r;
+
+template
+struct A {
+ virtual void f () { }
+ A() { f (); }
+ ~A() { f (); }
+};
+
+struct B : public A {
+ virtual void f () { ++r; }
+};
+
+int main ()
+{
+ { B b; }
+ return r;
+}
vtable1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array2-2.C
===================================================================
--- array2-2.C (nonexistent)
+++ array2-2.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2003
+
+// PR c++/13494. ICE
+
+template
+int foo(int d[][4])
+{
+ return d[0][0];
+}
+
array2-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup7.C
===================================================================
--- lookup7.C (nonexistent)
+++ lookup7.C (revision 338)
@@ -0,0 +1,9 @@
+class S;
+
+template
+int f(T, S);
+
+class S {
+ template
+ friend int f(T t, S) { t; return 0; }
+};
lookup7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp9.C
===================================================================
--- ttp9.C (nonexistent)
+++ ttp9.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Origin: David Abrahams
+// Wolfgang Bangerth
+
+// PR c++/12170: Deducing template template parameter from nested
+// class template.
+
+template struct W {};
+
+template< template class F, typename T>
+int foo(W< F >);
+
+
+template
+struct L {
+ static int const value = sizeof(foo(W()));
+ typedef T type;
+};
+
+
+template
+struct Y {
+ template struct X { typedef int type; };
+ typedef typename L >::type type;
+};
+
+template struct Y;
ttp9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef10.C
===================================================================
--- typedef10.C (nonexistent)
+++ typedef10.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/34573
+
+template < class Gtr_>
+void compute_gr()
+{
+ typedef int Less_chain;
+ struct utils {
+ utils(const Less_chain& lc) {};
+ };
+ utils U(1);
+}
+int main(void){
+ compute_gr();
+}
typedef10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static29.C
===================================================================
--- static29.C (nonexistent)
+++ static29.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/29570
+
+template struct A { static const int i; };
+
+template const int A::i = { A::i };
static29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: template-id-1.C
===================================================================
--- template-id-1.C (nonexistent)
+++ template-id-1.C (revision 338)
@@ -0,0 +1,33 @@
+// Copyright (C) 2002 Free Software Foundation
+// Origin: C++/1058
+// Contributed by Gabriel Dos Reis
+// { dg-do compile }
+
+struct A {
+ typedef int Y;
+ typedef double Z;
+};
+
+struct B {
+ template
+ void func(typename T::Y, typename T::Z) { }
+};
+
+template
+struct X {
+ void gunc();
+};
+
+template
+void X::gunc()
+{
+ B b;
+ b.func(0, 3.);
+}
+
+int main()
+{
+ X x;
+ x.gunc();
+ return 0;
+}
template-id-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested2.C
===================================================================
--- nested2.C (nonexistent)
+++ nested2.C (revision 338)
@@ -0,0 +1,9 @@
+template class CO {
+ class CI1 {
+ class CI2;
+ };
+};
+
+template
+class CO::CI1::CI2 {};
+
nested2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error38.C
===================================================================
--- error38.C (nonexistent)
+++ error38.C (revision 338)
@@ -0,0 +1,39 @@
+// Testcase for printing typename/typedef bindings as well as template args
+// in diagnostics (PR c++/25185)
+
+template
+struct A {
+ typename T::type f(); // { dg-message "typename T::type = void*" }
+ void f(int i = 0); // { dg-message "" }
+
+ typedef typename T::type mytype;
+ mytype g(); // { dg-message "mytype = void*" }
+ void g(int i = 0); // { dg-message "" }
+};
+
+struct B
+{
+ typedef void* type;
+};
+
+// Also make sure that deduced template arguments get canonicalized.
+
+template
+void f (T &t); // { dg-message "T = int" }
+
+template
+void f (T &t, int = 0); // { dg-message "" }
+
+typedef int myint;
+myint i;
+myint *p;
+
+int main()
+{
+ A a;
+ a.f(); // { dg-error "" }
+ a.g(); // { dg-error "" }
+
+ f(i); // { dg-error "" }
+ f(p); // { dg-error "" }
+}
error38.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec29.C
===================================================================
--- spec29.C (nonexistent)
+++ spec29.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/25855
+// { dg-do run }
+
+template int qCompare(const T *t1, const T *t2) { return 1; }
+template int qCompare(T *t1, T *t2) { return 2; }
+template int qCompare(const T1 *t1, const T2 *t2) {
+ return 3; }
+template<> int qCompare(const char *t1, const char *t2) { return 4; }
+int main()
+{
+ if (qCompare("a", "b") != 4)
+ return 1;
+}
spec29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend10.C
===================================================================
--- friend10.C (nonexistent)
+++ friend10.C (revision 338)
@@ -0,0 +1,45 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Dec 2002
+
+// PR 5116. template instantiation can add a friend into a namespace,
+// and thus change overload resolution.
+
+#include
+
+static int right;
+static int wrong;
+
+struct Buggy {};
+
+template struct Handle
+{
+ Handle(T* p) {}
+
+ operator bool() const { wrong++; return true; }
+
+ friend std::ostream& operator<<(std::ostream& ostr, const Handle& r)
+ {
+ right++;
+
+ return ostr << "in operator<<(ostream&, const Handle&)";
+ }
+};
+
+typedef Handle Buggy_h;
+
+bool cmp (const Buggy_h& b1, const Buggy_h& b2)
+{
+ std::cout << b1 << " " << b2 << std::endl;
+ return false;
+}
+
+int main()
+{
+ Buggy o;
+
+ cmp (&o, &o);
+
+ return !(right == 2 && !wrong);
+}
friend10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp13.C
===================================================================
--- ttp13.C (nonexistent)
+++ ttp13.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/15664: Template substitution of template template parameter
+
+template struct S {
+ template class A>
+ friend void foo();
+};
+
+template class A>
+void foo();
+
+template struct X {};
+
+int main () {
+ S<1> s;
+ foo();
+}
ttp13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: anon1.C
===================================================================
--- anon1.C (nonexistent)
+++ anon1.C (revision 338)
@@ -0,0 +1,21 @@
+struct x {
+ int foo () {}
+};
+
+template
+struct vector {
+ T& bar () {}
+};
+
+template
+struct y {
+ typedef struct {
+ x t;
+ } s;
+
+ vector array;
+
+ int foo ()
+ { return array.bar().t.foo(); }
+};
+int i = y().foo ();
anon1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pseudodtor4.C
===================================================================
--- pseudodtor4.C (nonexistent)
+++ pseudodtor4.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/34068
+// { dg-do compile }
+
+template struct A
+{
+ typedef int X;
+ A () { T (). ~X (); } // { dg-error "there are no arguments to|fpermissive|was not declared in this scope" }
+};
+
+A a;
pseudodtor4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-5.C
===================================================================
--- canon-type-5.C (nonexistent)
+++ canon-type-5.C (revision 338)
@@ -0,0 +1,22 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+struct Foo {};
+template struct A ;
+template > struct B { } ;
+
+template
+struct D
+{
+ typedef W X ;
+ A a ;
+} ;
+
+template
+struct E
+{
+ B b ;
+} ;
+E < int > e ;
+
canon-type-5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash69.C
===================================================================
--- crash69.C (nonexistent)
+++ crash69.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/31132
+
+template class A
+{
+ static int i; // { dg-error "is private" }
+ friend int T::foo(); // { dg-error "does not match" }
+};
+
+struct B
+{
+ void foo() { A::i; } // { dg-error "within|candidate" }
+};
crash69.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local6.C
===================================================================
--- local6.C (nonexistent)
+++ local6.C (revision 338)
@@ -0,0 +1,19 @@
+template struct PCVector2
+{ // { dg-message "candidate is" }
+ template PCVector2(const PCVector2 &cv) ;
+
+ PCVector2 operator- (const PCVector2 &ov) const
+ {
+ return PCVector2(ov.xFIELD, ov.yFIELD); // { dg-error "matching" }
+ }
+
+ T xFIELD, yFIELD;
+};
+
+void findIntersection( PCVector2& p0, PCVector2& p1);
+
+
+void findIntersection( PCVector2& p0, PCVector2& p1)
+{
+ PCVector2 e = p1 - p0; // { dg-message "instantiated" }
+}
local6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static9.C
===================================================================
--- static9.C (nonexistent)
+++ static9.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/17524
+
+template struct A
+{
+ static const T i = 0; // { dg-error "declared void" "void" }
+ // { dg-error "invalid" "invalid" { target *-*-* } 5 }
+};
+
+A a; // { dg-message "instantiated" }
static9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef3.C
===================================================================
--- typedef3.C (nonexistent)
+++ typedef3.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/19397
+// { dg-do compile }
+
+template struct A
+{
+ typedef int ::template; // { dg-error "template" }
+};
typedef3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo1.C
===================================================================
--- repo1.C (nonexistent)
+++ repo1.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-options "-frepo" }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+struct A {
+ A();
+};
+
+A::A() {}
+
+template
+struct B : public A {
+ B() {} // { dg-bogus "" }
+};
+
+B b;
+
+int main () {}
+
+// { dg-final { cleanup-repo-files } }
repo1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mem-partial3.C
===================================================================
--- mem-partial3.C (nonexistent)
+++ mem-partial3.C (revision 338)
@@ -0,0 +1,29 @@
+// PR c++/33342
+
+template
+struct enable_if_c {
+ typedef T type;
+};
+
+template
+struct A
+{
+ template
+ struct B;
+
+ template
+ struct B::type>
+ { };
+};
+
+struct C
+{
+ struct sub
+ {
+ static const int value = 0;
+ };
+};
+
+
+A a;
+A::B b;
mem-partial3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor3.C
===================================================================
--- dtor3.C (nonexistent)
+++ dtor3.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/19762
+
+template struct A { ~A(){} }; // { dg-error "" }
+template A<>::~A(); // { dg-error "template|declaration" }
dtor3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload1.C
===================================================================
--- overload1.C (nonexistent)
+++ overload1.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-options "-w" }
+// PR c++/9420
+// Bug: We were instantiating B during overload resolution for E<0.
+// This is wrong; the contents of B are not relevant, since we can't
+// use its constructors (because we'd already be using a constructor for
+// C).
+
+enum { E };
+
+template struct A {
+ static const int a = (E < 0);
+};
+
+template class B {
+ A b;
+};
+
+struct C {
+ C(B);
+};
+
+int operator<(C, C);
+
+A c;
overload1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor6.C
===================================================================
--- ctor6.C (nonexistent)
+++ ctor6.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/25663
+
+template struct A
+{
+ A(int);
+};
+
+void foo()
+{
+ A<0>(A<0>(0));
+}
ctor6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent11.C
===================================================================
--- non-dependent11.C (nonexistent)
+++ non-dependent11.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Origin: Jakub Jelinek
+// Wolfgang Bangerth
+
+// PR c++/19311: Non-dependent address to member as function argument.
+
+template void foo (R (T::*x) ());
+template void foo (R (T::*x) (C));
+
+template struct I {
+ int o ();
+ int o () const;
+};
+
+template void bar (void) {
+ foo > (&I<1>::o);
+}
non-dependent11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call5.C
===================================================================
--- call5.C (nonexistent)
+++ call5.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/36631
+// { dg-options "-O0" }
+
+template struct B
+{
+ struct C
+ {
+ __attribute__ ((always_inline)) C (C const &c) {}
+ };
+ void __attribute__ ((always_inline)) g (C c) {}
+};
+
+void
+trigger (B b, B ::C c)
+{
+ b.g (c);
+}
call5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash11.C
===================================================================
--- crash11.C (nonexistent)
+++ crash11.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+// Origin: kparz@iastate.edu
+
+// PR c++/7939: ICE for invalid function parameter after template
+// substitution.
+
+template void foo(T, U) {}
+template void foo(T, void) {} // { dg-error "incomplete|invalid|partial" }
crash11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype16.C
===================================================================
--- nontype16.C (nonexistent)
+++ nontype16.C (revision 338)
@@ -0,0 +1,9 @@
+//PR c++/27962
+
+template struct A
+{
+ template void foo();
+};
+
+template<> template void A<0>::foo() {} // { dg-error "not a valid type" }
+
nontype16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit2.C
===================================================================
--- explicit2.C (nonexistent)
+++ explicit2.C (revision 338)
@@ -0,0 +1,10 @@
+struct X {
+ template void foo(B);
+};
+
+template
+void bar() {
+ X().foo(1);
+}
+
+template void bar ();
explicit2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: koenig8.C
===================================================================
--- koenig8.C (nonexistent)
+++ koenig8.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/40740
+
+template
+T addsome(T v) {
+ return v+1;
+}
+
+int addsome(int v) {
+ return v+2;
+}
+
+int main() {
+ int i = 0;
+ if (addsome(i) != 2)
+ return 1;
+ if (addsome<>(i) != 1)
+ return 2;
+ return 0;
+}
+
koenig8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate4.C
===================================================================
--- instantiate4.C (nonexistent)
+++ instantiate4.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/10682: Typedef to enum template instantiation logic.
+
+template
+struct Foo {
+ enum E {a,b,c};
+ typedef E EE;
+};
+
+void Baz(Foo::EE x);
instantiate4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend11.C
===================================================================
--- memfriend11.C (nonexistent)
+++ memfriend11.C (revision 338)
@@ -0,0 +1,73 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class template of class template as friend
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+class C {
+ int i;
+ template template friend struct A::B;
+};
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template<> struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::B<'b'>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int d2 = 0;
+
+int main()
+{
+ A::B<0> b1;
+ b1.f();
+ A::B<&d2> b2;
+ b2.f();
+ A::B<'a'> b3;
+ b3.f();
+ A::B<'b'> b4;
+ b4.f();
+}
memfriend11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: varmod1.C
===================================================================
--- varmod1.C (nonexistent)
+++ varmod1.C (revision 338)
@@ -0,0 +1,10 @@
+// { dg-options "-w" }
+
+template void foo(T);
+
+void bar()
+{
+ int i;
+ int A[i][i];
+ foo(A); // { dg-error "" }
+}
varmod1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg3.C
===================================================================
--- defarg3.C (nonexistent)
+++ defarg3.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003
+
+// PR c++ 11596
+
+template struct A { enum { value }; };
+template struct B { enum { value = A<1>::value }; };
+int ary[!B<1>::value ? 1 : -1];
+
+template struct A1 { enum { value = 1}; };
+template struct A1 { enum { value}; };
+template struct B1 { enum { value = A1<1>::value }; };
+
+int ary1[!B1<1>::value ? 1 : -1];
defarg3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static21-a.cc
===================================================================
--- static21-a.cc (nonexistent)
+++ static21-a.cc (revision 338)
@@ -0,0 +1,17 @@
+template
+ struct X
+ {
+ static const int n_primes = 256;
+ static const unsigned long primes[n_primes + 1];
+ };
+
+ template
+ const int X::n_primes;
+
+ template
+ const unsigned long X::primes[n_primes + 1] =
+ { 0 };
+
+
+const unsigned long *f1(void){return &X<0>::primes[0];}
+int main(){}
Index: ttp22.C
===================================================================
--- ttp22.C (nonexistent)
+++ ttp22.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/28860
+// { dg-do compile}
+
+template class A>
+class A<0>; // { dg-error "shadows template template parameter" }
+
+template class B>
+class B<0> {}; // { dg-error "shadows template template parameter" }
ttp22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem18.C
===================================================================
--- ptrmem18.C (nonexistent)
+++ ptrmem18.C (revision 338)
@@ -0,0 +1,49 @@
+// PR c++/33616
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" void abort ();
+
+struct S {
+ int c;
+ S () : c (0) {}
+ virtual void f1 () { c += 1; }
+ virtual void f2 () { c += 16; }
+};
+
+struct T {
+ S s;
+};
+
+typedef void (S::*Q) ();
+
+template
+void test1 (T *t) +{ + (t->s.*P)(); +} + +template+void test2 (T *t) +{ + S &s = t->s; + (s.*P)(); +} + +int +main () +{ + T t; + test1 <&S::f1> (&t); + if (t.s.c != 1) + abort (); + test1 <&S::f2> (&t); + if (t.s.c != 17) + abort (); + test2 <&S::f1> (&t); + if (t.s.c != 18) + abort (); + test2 <&S::f2> (&t); + if (t.s.c != 34) + abort (); +}
ptrmem18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using9.C
===================================================================
--- using9.C (nonexistent)
+++ using9.C (revision 338)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+// Origin: stefaandr@hotmail.com
+
+// PR c++/17154: Using declaration in partial class template specialization.
+
+template struct A { void test_A() {} };
+template struct B {};
+template struct B <3, T> : public A <3, T> {
+ using A <3, T>::test_A;
+ void test_B_spec() { test_A(); }
+};
using9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash78.C
===================================================================
--- crash78.C (nonexistent)
+++ crash78.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/35077
+
+template
crash78.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array11.C
===================================================================
--- array11.C (nonexistent)
+++ array11.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Origin: Giovanni Bajo
+// PR c++/19208: Fold dependent array domains
+
+template struct if_t { typedef int type; };
+template struct ffff { static const bool value = true; };
+template
+struct bound_member_action
+{
+ typedef char f[ffff::value ? 1 : 2];
+ template
+ bound_member_action(CT i, typename if_t::type g) {}
+};
+bound_member_action a(0, 1);
array11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial4.C
===================================================================
--- partial4.C (nonexistent)
+++ partial4.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/25342
+
+template < typename eval >
+struct tpl_seq_search {
+ typedef typename eval::enum_type Enum;
+ template < Enum first, Enum last >
+ struct range {
+ };
+ template < Enum val >
+ struct range {
+ };
+};
+struct xxx {
+ typedef int enum_type;
+ tpl_seq_search::range<0, 1> a;
+};
partial4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent3.C
===================================================================
--- non-dependent3.C (nonexistent)
+++ non-dependent3.C (revision 338)
@@ -0,0 +1,15 @@
+//PR c++/11071
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template struct X {
+ template
+ static int* execute(T* x) { return x; }
+};
+
+template void foo() {
+ static bool const same = true;
+ X::execute ((int*)0);
+}
+
+template void foo ();
non-dependent3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access1.C
===================================================================
--- access1.C (nonexistent)
+++ access1.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 19 Jan 2002
+
+// It is legal to specialize a template with a different class-key.
+
+template class X;
+
+template struct X
+{
+ int i;
+};
+template<> struct X
+{
+ int i;
+};
+
+void foo ()
+{
+ X xip;
+ X xi;
+
+ xip.i;
+ xi.i;
+}
+
access1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype7.C
===================================================================
--- nontype7.C (nonexistent)
+++ nontype7.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// Origin: C++ standard, [temp.arg.nontype]/2
+
+template struct X {
+ X();
+ X(const char* q) { /* ... */ }
+};
+
+char p[] = "Vivisectionist";
+
+X x1; // { dg-error "string literal" }
+X x2;
+
+// { dg-bogus "" "additional errors" { xfail *-*-* } 11 }
+
nontype7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash4.C
===================================================================
--- crash4.C (nonexistent)
+++ crash4.C (revision 338)
@@ -0,0 +1,12 @@
+namespace NS {
+ struct C {};
+ void foo();
+}
+
+template struct X {};
+
+template struct A {
+ A() { foo (X()); }
+ void foo(X);
+};
+template struct A;
crash4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename14.C
===================================================================
--- typename14.C (nonexistent)
+++ typename14.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Jul 2007
+
+template struct A
+{
+ typedef const T X;
+
+ struct B;
+};
+
+template struct A::B
+{
+ typedef volatile typename A::X Y;
+
+ T const volatile *Foo ();
+};
+
+template
+typename A::B::Y *A::B::Foo ()
+{
+ return 0;
+}
typename14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: duplicate1.C
===================================================================
--- duplicate1.C (nonexistent)
+++ duplicate1.C (revision 338)
@@ -0,0 +1,7 @@
+//PR c++/19439
+
+template struct A
+{
+ ~A() {} // { dg-error "with" }
+ ~A() {} // { dg-error "cannot be overloaded" }
+};
duplicate1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend7.C
===================================================================
--- memfriend7.C (nonexistent)
+++ memfriend7.C (revision 338)
@@ -0,0 +1,133 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Member function of class template as friend
+// Erroneous case: mismatch during specialization
+
+template struct A {
+ template void f(U);
+ void g();
+ void h();
+ void i(int);
+ template void j();
+};
+
+class C {
+ int ii; // { dg-error "private" }
+ template template
+ friend void A::f(V);
+ template friend void A::g();
+ template friend void A::h();
+ template friend void A::i(int);
+ template template
+ friend void A::j();
+};
+
+template struct A {
+ void f(int);
+ template void g();
+ int h();
+ void i(char);
+ template void j();
+};
+
+template void A::f(int)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template template void A::g()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template int A::h()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template void A::i(char)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template template void A::j()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> struct A {
+ void f(int);
+ template void g();
+ int h();
+ void i(char);
+ template void j();
+};
+
+void A::f(int)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template void A::g()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> void A::g()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+int A::h()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+void A::i(char)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template void A::j()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> void A::j<0>()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+int main()
+{
+ A a1;
+ a1.f(0); // { dg-message "instantiated" }
+ a1.g(); // { dg-message "instantiated" }
+ a1.g(); // { dg-message "instantiated" }
+ a1.h(); // { dg-message "instantiated" }
+ a1.i('a'); // { dg-message "instantiated" }
+ a1.j<1>(); // { dg-message "instantiated" }
+ A a2;
+ a2.f(0);
+ a2.g(); // { dg-message "instantiated" }
+ a2.g();
+ a2.h();
+ a2.i('a');
+ a2.j<1>(); // { dg-message "instantiated" }
+ a2.j<0>();
+}
memfriend7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend7.C
===================================================================
--- friend7.C (nonexistent)
+++ friend7.C (revision 338)
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+template
+struct b
+{
+ template
+ class a
+ {
+ template
+ friend class a;
+
+ T t_;
+
+ public:
+ a() {}
+ a(a const &);
+ };
+};
+
+template
+template
+b::a::a(a const &rhs): t_(*rhs.t_)
+{}
+
+
+int
+f ()
+{
+ b::a q;
+ b::a w(q);
+
+ return 0;
+}
friend7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: char1.C
===================================================================
--- char1.C (nonexistent)
+++ char1.C (revision 338)
@@ -0,0 +1,4 @@
+template
+class String {};
+
+String s;
char1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vtable2.C
===================================================================
--- vtable2.C (nonexistent)
+++ vtable2.C (revision 338)
@@ -0,0 +1,18 @@
+// Use a small template instantiation depth to speed up testing
+// { dg-options "-ftemplate-depth-5" }
+// { dg-do compile }
+
+// Origin: rullo.pat@tiscalinet.it
+// Nathanael Nerode
+// Wolfgang Bangerth
+
+// PR c++/6749: Infinite loop generating vtable.
+
+template struct inner {};
+
+template struct parent {
+ virtual void f() // { dg-error "instantiation depth" }
+ { parent > p; };
+};
+
+template struct parent;
vtable2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: lookup8.C
===================================================================
--- lookup8.C (nonexistent)
+++ lookup8.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/38030
+// The call to f should be resolved at template definition time.
+// { dg-do link }
+
+struct B { };
+struct D : public B { };
+D d;
+void f (B &) { }
+template < class T >
+void g ()
+{
+ return f (d);
+}
+void f (D &);
+int main ()
+{
+ g ();
+ return 0;
+}
lookup8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash20.C
===================================================================
--- crash20.C (nonexistent)
+++ crash20.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2004
+
+// ICE with incompletable type.
+
+class INC;
+
+template class B {};
+
+template void Foo (B &);
+
+void Foo (INC &);
+
+void Baz (INC *p)
+{
+ Foo (*p);
+}
+
crash20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef11.C
===================================================================
--- typedef11.C (nonexistent)
+++ typedef11.C (revision 338)
@@ -0,0 +1,25 @@
+// Author: Dodji Seketeli
+// Origin: PR c++/26693
+// { dg-do compile }
+
+
+class Alpha
+{
+ typedef int X; // { dg-error "'typedef int Alpha::X' is private" }
+};
+
+template
+class Beta
+{
+ typedef int Y; // { dg-error "'typedef int Beta<0>::Y' is private" }
+};
+
+template
+int
+bar ()
+{
+ Beta<0>::Y i = 0;
+ return Alpha::X ();
+}
+
+int i = bar<0> (); // { dg-error "within this context" }
typedef11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: template-id-2.C
===================================================================
--- template-id-2.C (nonexistent)
+++ template-id-2.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Richard Guenther
+
+// PR c++/12924
+
+template struct A {};
+
+template<> struct A
+{
+ template void foo()
+ {
+ A a;
+ a.template foo(); // { dg-error "no member" }
+ }
+};
+
+void bar()
+{
+ A a;
+ a.foo(); // { dg-message "instantiated" }
+}
template-id-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested3.C
===================================================================
--- nested3.C (nonexistent)
+++ nested3.C (revision 338)
@@ -0,0 +1,30 @@
+template
+class A {
+ template
+ class SubA {
+ int _k;
+ };
+ T1 _t1;
+ T2 _t2;
+};
+
+template
+class B {
+ class SubB1 {
+ B _i;
+ };
+
+ class SubB2 {
+ int _j;
+ };
+ A::SubA _a; // { dg-error "not a base type" "not base" }
+ // { dg-message "note" "note" { target *-*-* } 20 }
+ // { dg-error "non-template" "non-template" { target *-*-* } 20 }
+};
+
+
+int main() {
+ B objB; // { dg-message "instantiated" }
+
+ return 0;
+}
nested3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error39.C
===================================================================
--- error39.C (nonexistent)
+++ error39.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/14912
+
+template
+struct A
+{
+};
+
+void foo(void)
+{
+ A a = 0; // { dg-error "A" }
+}
error39.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend11.C
===================================================================
--- friend11.C (nonexistent)
+++ friend11.C (revision 338)
@@ -0,0 +1,18 @@
+/* PR c++/53 */
+/* { dg-do compile } */
+
+template
+struct A {
+ template class B;
+
+ // Did not compile with gcc-2.95.2 (linux i686) :-(
+ template template friend class A::B;
+};
+
+template template class A::B {
+};
+
+int main(){
+ A::B ab;
+ return 0;
+}
friend11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp14.C
===================================================================
--- ttp14.C (nonexistent)
+++ ttp14.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Origin: akim@epita.fr
+// Volker Reichelt
+
+// PR c++/18276: Template substitution of template template parameter
+
+template class> struct A;
+
+template struct B
+{
+ template class> friend class A;
+};
+
+B<0> b;
ttp14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: anon2.C
===================================================================
--- anon2.C (nonexistent)
+++ anon2.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/28279
+// finish_static_data_member_decl was confused by the anonymous
+// namespace causing TREE_PUBLIC to be unset
+
+template
+struct is_pointer_impl {
+ static const bool value = true;
+};
+
+namespace {
+ class prefix_name_mapper {};
+}
+
+static const bool val = is_pointer_impl::value;
+
anon2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pseudodtor5.C
===================================================================
--- pseudodtor5.C (nonexistent)
+++ pseudodtor5.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/37563
+
+struct A {};
+
+template struct Traits
+{
+ typedef void X;
+};
+
+template<> struct Traits<0>
+{
+ typedef A X;
+};
+
+template struct B
+{
+ typedef typename Traits::X Y;
+
+ void foo(Y y)
+ {
+ y.Y::A::~A();
+ }
+};
pseudodtor5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash87.C
===================================================================
--- crash87.C (nonexistent)
+++ crash87.C (revision 338)
@@ -0,0 +1,27 @@
+// Origin: PR c++/38357
+// { dg-do compile }
+
+class BUG
+{
+public:
+ bool name() { return true; }
+};
+
+template
+struct BUG1_5
+{
+
+};
+
+template
+class BUG2 : BUG
+{
+public:
+ typedef BUG1_5 ptr; // { dg-error "could not convert template argument" }
+};
+
+int main()
+{
+ BUG2 b;
+ return 0;
+}
crash87.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-6.C
===================================================================
--- canon-type-6.C (nonexistent)
+++ canon-type-6.C (revision 338)
@@ -0,0 +1,22 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+struct Foo {};
+template struct A ;
+template > struct B { } ;
+
+template
+struct D
+{
+ typedef W X;
+ A a;
+} ;
+
+template
+struct E
+{
+ B b;
+};
+E < int > e ;
+
canon-type-6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array20.C
===================================================================
--- array20.C (nonexistent)
+++ array20.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/38950
+
+template void f(T(&)[N]);
+
+int main() {
+ int x[2];
+ unsigned int y[2];
+ f(x); // works
+ f(y); // ICE
+}
array20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: restrict1.C
===================================================================
--- restrict1.C (nonexistent)
+++ restrict1.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/6392
+// Bug: We tried to make the array restricted, which doesn't make sense.
+
+template
+class bob
+{
+ T * __restrict a[50];
+};
restrict1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef4.C
===================================================================
--- typedef4.C (nonexistent)
+++ typedef4.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/27572
+// { dg-do compile }
+
+template void foo(); // { dg-error "no type|typedef declaration|template" }
+
+void bar()
+{
+ foo(); // { dg-error "matching" }
+}
typedef4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo2.C
===================================================================
--- repo2.C (nonexistent)
+++ repo2.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/17163
+// { dg-options "-frepo" }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+template
+struct __Atomicity_lock
+{
+ static unsigned char _S_atomicity_lock;
+};
+template
+unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
+int main () {
+}
+
+// { dg-final { cleanup-repo-files } }
repo2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typeid-template-argument.C
===================================================================
--- typeid-template-argument.C (nonexistent)
+++ typeid-template-argument.C (revision 338)
@@ -0,0 +1,7 @@
+// This used to ICE (PR28420)
+
+// { dg-do compile }
+
+template struct A;
+
+int i = sizeof(A); // { dg-error "operator cannot appear in a constant-expression|template argument 1 is invalid" }
typeid-template-argument.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: complit1.C
===================================================================
--- complit1.C (nonexistent)
+++ complit1.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-options "" }
+
+template struct C {
+ int d[3];
+ C();
+};
+
+template
+C::C() : d((int[]){1,2,3}) {} // { dg-error "array" }
+
+template class C<1>;
complit1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: scope1.C
===================================================================
--- scope1.C (nonexistent)
+++ scope1.C (revision 338)
@@ -0,0 +1,12 @@
+// PR 8327
+
+template
+class X
+{
+ static const int a = 5;
+
+ static T b[a];
+};
+
+template T X::b[X::a];
+
scope1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor4.C
===================================================================
--- dtor4.C (nonexistent)
+++ dtor4.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/19440
+// Origin: Volker Reichelt
+
+// { dg-do compile }
+
+template struct A
+{
+ ~A<0>(); // { dg-error "parse error|declaration" }
+};
dtor4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator10.C
===================================================================
--- operator10.C (nonexistent)
+++ operator10.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/30535
+
+struct A {};
+
+template int operator-(A, T); // { dg-error "not a valid type" }
+
+int i = A() - 0; // { dg-error "no match" }
operator10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload2.C
===================================================================
--- overload2.C (nonexistent)
+++ overload2.C (revision 338)
@@ -0,0 +1,15 @@
+template struct foo;
+
+template
+int f(foo*);
+
+template
+char* f(...);
+
+struct X { int ob_type; };
+struct Y { char* ob_type; };
+ int x = f(0);
+char* y = f(0);
+char* z = f(0);
+
+int main() { return 0; }
overload2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor7.C
===================================================================
--- ctor7.C (nonexistent)
+++ ctor7.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/27640
+
+template < class T > struct refcounted :
+virtual T
+{
+ template < class A1 > refcounted (const A1 & a1) : T () { }
+};
+struct nfsserv {};
+template < class T >
+void
+sfsserver_cache_alloc (int *ns)
+{
+ new refcounted < nfsserv > (*ns);
+}
+void
+usage ()
+{
+ sfsserver_cache_alloc < int > ( 0);
+}
ctor7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent12.C
===================================================================
--- non-dependent12.C (nonexistent)
+++ non-dependent12.C (revision 338)
@@ -0,0 +1,10 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 8 Mar 2005
+
+// PR 20186: ICE
+// Origin: Jan Dvorak
+
+template void foo(T &t)
+{
+ int i = static_cast(t);
+}
non-dependent12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: asm1.C
===================================================================
--- asm1.C (nonexistent)
+++ asm1.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/24761
+// { dg-do compile }
+
+template
+int f (int i)
+{
+ asm ("# %0 %1" : "+r" (i));
+ return i;
+}
+
+int main ()
+{
+ return f<0> (0) + f<1> (0);
+}
asm1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call6.C
===================================================================
--- call6.C (nonexistent)
+++ call6.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/38577
+// { dg-do compile }
+
+struct A
+{
+ static A *bar ();
+};
+
+struct B : public A
+{
+ static void baz ();
+};
+
+template
+void foo ()
+{
+ (static_cast (A::bar ()))->baz ();
+}
+
+void
+bar ()
+{
+ foo ();
+}
call6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef20.C
===================================================================
--- typedef20.C (nonexistent)
+++ typedef20.C (revision 338)
@@ -0,0 +1,27 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/40007
+// { dg-do compile }
+
+class x
+{
+ typedef int privtype; // { dg-error "is private" }
+
+protected:
+ typedef int type;
+};
+
+template
+struct y : public x
+{
+ typename x::type z;
+};
+
+template
+struct y : public x
+{
+ typedef x::type good;
+ typedef x::privtype bad; // { dg-error "within this context" }
+};
+
+template class y;
+template class y;
typedef20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash12.C
===================================================================
--- crash12.C (nonexistent)
+++ crash12.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: rmerkert@alphatech.com
+// Volker Reichelt
+
+// PR c++/12495: ICE looking up class template in local class.
+
+template struct A {};
+
+template void foo()
+{
+ struct B
+ {
+ B (const A&);
+ };
+}
crash12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype17.C
===================================================================
--- nontype17.C (nonexistent)
+++ nontype17.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/35282
+
+template struct A
+{
+ template void foo();
+};
+
+template<> template void A<0>::foo() {}
nontype17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit3.C
===================================================================
--- explicit3.C (nonexistent)
+++ explicit3.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003
+
+// Failed to spot specialization using a template-id expr
+
+template class A {};
+template class R {};
+
+template struct Trait { enum {m = n}; };
+
+template R::m> f(A);
+template <> R::m> f<1>(A<1>) {return R<1>();}
+
+void Baz ()
+{
+ R::m> (*ptr) (A<1>);
+
+ ptr = &f<1>;
+
+}
explicit3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate5.C
===================================================================
--- instantiate5.C (nonexistent)
+++ instantiate5.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt
+
+// PR c++/11616: Incorrect line number in diagnostics
+
+template struct A
+{
+ static const int i=0;
+};
+
+int baz() { return A<0>::i; }
+
+struct B
+{
+ static void foo (int); // { dg-message "candidate is" }
+};
+
+template struct C
+{
+ virtual void bar() const { T::foo(); } // { dg-error "no matching function" }
+};
+
+C c; // { dg-message "instantiated" }
instantiate5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend12.C
===================================================================
--- memfriend12.C (nonexistent)
+++ memfriend12.C (revision 338)
@@ -0,0 +1,63 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class of class template as friend
+
+template struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+template class C {
+ int i;
+ template friend struct A::B;
+};
+
+template struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+template<> struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A::B b1;
+ b1.f();
+ A::B b2;
+ b2.f();
+ A::B b3;
+ b3.f();
+}
memfriend12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend20.C
===================================================================
--- friend20.C (nonexistent)
+++ friend20.C (revision 338)
@@ -0,0 +1,15 @@
+template
+struct A
+{
+ friend void bar(A a) {}
+};
+
+void bar(A);
+
+int main()
+{
+ A a;
+
+ bar(a);
+}
+
friend20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg4.C
===================================================================
--- defarg4.C (nonexistent)
+++ defarg4.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/14763
+
+struct A {
+ int get() const {}
+ static A *foo();
+};
+
+template struct S {
+ S(unsigned int = A::foo()->get()) ;
+};
+
+void foo() throw() {
+ S f;
+}
defarg4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp23.C
===================================================================
--- ttp23.C (nonexistent)
+++ ttp23.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/29236
+
+template struct A {};
+
+template class P>
+struct B {
+ template class Q>
+ friend bool foo (const B
& a); +}; + +template class Q> +bool foo (const B& a); + +void bar () { + B a; + foo (a); +}
ttp23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem19.C
===================================================================
--- ptrmem19.C (nonexistent)
+++ ptrmem19.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/40780
+// { dg-do compile }
+
+template
+struct A
+{
+ typedef T2 (T1::*m) (T3);
+ A (m) {}
+};
+struct B;
+struct C
+{
+ void foo (B *);
+};
+typedef A D;
+typedef void (C::*E) (B *);
+struct F;
+typedef void (C::*G) (F);
+D d ((E) (G) & C::foo);
ptrmem19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash96.C
===================================================================
--- crash96.C (nonexistent)
+++ crash96.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/40406
+
+template struct A
+{
+ template template void A::foo() {} // { dg-error "extra qualification" }
+};
crash96.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash79.C
===================================================================
--- crash79.C (nonexistent)
+++ crash79.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/36404
+
+struct A
+{
+ A(int);
+ template enum { e }; // { dg-error "template|expected" }
+}; // { dg-error "expected" }
+
+A a(A::e);
crash79.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial5.C
===================================================================
--- partial5.C (nonexistent)
+++ partial5.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/33964
+
+template
+struct X { };
+
+template
+struct X { }; // { dg-error "not used|T" }
+
+template
+struct X {}; // okay
+
+
+template
+struct Y { };
+
+template
+struct Y { }; // { dg-error "not used|U" }
+
+
+template
+struct Z { };
+
+template
+struct Z { }; // { dg-error "involves template parameter" }
partial5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent4.C
===================================================================
--- non-dependent4.C (nonexistent)
+++ non-dependent4.C (revision 338)
@@ -0,0 +1,4 @@
+int temp(const char *temp);
+
+template int g() { return temp("Hi"); }
+int g1() { return temp("Hi"); }
non-dependent4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access2.C
===================================================================
--- access2.C (nonexistent)
+++ access2.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// PR c++/5387
+// Enforcing access of typename type.
+
+template struct A {
+ typename T::X x; // { dg-error "this context" }
+ int f() { return T::i; } // { dg-error "this context" }
+};
+
+class B {
+ typedef int X; // { dg-error "private" }
+ static int i; // { dg-error "private" }
+};
+
+int main()
+{
+ A ab; // { dg-message "instantiated" }
+ ab.f(); // { dg-message "instantiated" }
+}
access2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype8.C
===================================================================
--- nontype8.C (nonexistent)
+++ nontype8.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// Origin: C++ standard, [temp.arg.nontype]/3
+
+template class X { };
+
+int a[10];
+struct S { int m; static int s; } s;
+
+X<&a[2]> x3; // { dg-error "" } address of array element
+X<&s.m> x4; // { dg-error "" } address of non-static member
+X<&s.s> x5; // { dg-error "" } &S::s must be used
+X<&S::s> x6; // OK: address of static member
+
nontype8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename15.C
===================================================================
--- typename15.C (nonexistent)
+++ typename15.C (revision 338)
@@ -0,0 +1,12 @@
+// PR37314 ice-on-valid-code, from w.doeringer
+template
+class Cdeque {
+ typedef T *pointer;
+ class iterator {
+ typedef typename Cdeque::pointer pointer;
+ pointer operator->();
+ };
+};
+template T* Cdeque::iterator::operator->() { }
+
+
typename15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member2.C
===================================================================
--- member2.C (nonexistent)
+++ member2.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/8660
+// Bug: we were treating the definition of the non-template as a definition
+// of the template, which broke.
+
+struct BadgerBuf
+{
+ void ReadPod();
+ template
+ void ReadPod();
+};
+
+void BadgerBuf::ReadPod ()
+ { ReadPod (); }
member2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend8.C
===================================================================
--- memfriend8.C (nonexistent)
+++ memfriend8.C (revision 338)
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Origin: Martin Sebor
+
+// PR c++/5369: Member function of class template as friend
+
+template
+struct S
+{
+ int foo () {
+ return S::bar ();
+ }
+
+private:
+
+ template
+ friend int S::foo ();
+
+ static int bar () { return 0; }
+};
+
+int main ()
+{
+ S().foo ();
+}
memfriend8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend8.C
===================================================================
--- friend8.C (nonexistent)
+++ friend8.C (revision 338)
@@ -0,0 +1,18 @@
+template struct ivector
+{
+ template friend void
+ mult_mv ();
+};
+
+template struct ivector<3>;
+
+template void
+mult_mv ()
+{
+ c;
+}
+
+void get_local_point_pos ()
+{
+ mult_mv<7, 3> ();
+}
friend8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash21.C
===================================================================
--- crash21.C (nonexistent)
+++ crash21.C (revision 338)
@@ -0,0 +1,40 @@
+// { dg-do compile }
+
+// Origin: Debian GCC maintainers
+// Wolfgang Bangerth
+
+// PR c++/16706: Dependent type calculation during access checking
+
+template struct B {
+ B() throw() {}
+ struct S { };
+ static int i;
+ typedef unsigned short int dummy;
+};
+
+template
+struct allocator: B<_Tp> {
+ template struct rebind
+ { typedef allocator<_Tp1> other; };
+};
+
+template
+struct X {
+ typename allocator::template rebind::other i;
+ typedef int* dummy;
+};
+
+template class A {
+ typedef typename X >::dummy dummy;
+ template class XWrapper;
+};
+
+
+template
+template struct A::XWrapper
+{
+ XWrapper() {}
+ X > x;
+};
+
+template class A::XWrapper;
crash21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef12.C
===================================================================
--- typedef12.C (nonexistent)
+++ typedef12.C (revision 338)
@@ -0,0 +1,23 @@
+// Contributed by Dodji Seketeli
+// Origin: Jason Merrill , PR c++/26693
+// { dg-do compile }
+
+class A
+{
+ protected:
+ typedef int mytype;
+};
+
+template class B;
+
+class C: public A
+{
+ template friend class B;
+};
+
+template class B
+{
+ C::mytype mem;
+};
+
+B b;
typedef12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename1.C
===================================================================
--- typename1.C (nonexistent)
+++ typename1.C (revision 338)
@@ -0,0 +1,9 @@
+// Origin: Volker Reichelt
+// { dg-do compile }
+
+template
+class B : virtual T::A
+{
+ typedef int INT;
+ INT i;
+};
typename1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested4.C
===================================================================
--- nested4.C (nonexistent)
+++ nested4.C (revision 338)
@@ -0,0 +1,10 @@
+template struct A {
+ template struct B { typedef A X; };
+
+};
+
+template void f() {
+ typedef A::B::X X;
+}
+
+template void f ();
nested4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend12.C
===================================================================
--- friend12.C (nonexistent)
+++ friend12.C (revision 338)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR 9030. Perform access checking to parameter and return type of
+// function template correctly when the template is friend.
+
+template class Outer {
+ private:
+ struct Inner {};
+
+ template
+ friend typename Outer::Inner foo ();
+};
+
+template
+typename Outer::Inner
+foo () {
+ return typename Outer::Inner();
+}
+
+void f() {
+ foo();
+}
friend12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator1.C
===================================================================
--- operator1.C (nonexistent)
+++ operator1.C (revision 338)
@@ -0,0 +1,49 @@
+class test
+{
+public:
+ float operator[]( int index )
+ {
+ return testFloat[index];
+ }
+private:
+ float testFloat[3];
+};
+
+template < class typeA > float
+operator*(
+ typeA a,
+ float b
+)
+{
+ return a[0] * b;
+}
+
+template < class typeB > float
+operator*(
+ float a,
+ typeB b
+)
+{
+ return a * b[0];
+}
+
+template < class typeA, class typeB > float
+operator*(
+ typeA a,
+ typeB b
+)
+{
+ return a[0] * b[0];
+}
+
+int main( void )
+{
+ test aTest;
+ float bTest;
+ float result;
+
+ result = aTest * bTest;
+ result = bTest * aTest;
+
+ return 0;
+}
operator1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp15.C
===================================================================
--- ttp15.C (nonexistent)
+++ ttp15.C (revision 338)
@@ -0,0 +1,21 @@
+struct Dense {
+ static const unsigned int dim = 1;
+};
+
+template class View,
+ typename Block>
+void operator+(float, View const&);
+
+template
+struct Lvalue_proxy {
+ operator float() const;
+};
+
+void
+test_1d (void)
+{
+ Lvalue_proxy p;
+ float b;
+ b + p;
+}
ttp15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: anon3.C
===================================================================
--- anon3.C (nonexistent)
+++ anon3.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/28370
+// { dg-do run }
+
+namespace
+{
+ template struct A { static int *a; };
+ template int *A::a = 0;
+}
+
+int *
+foo ()
+{
+ return A::a;
+}
+
+int
+main ()
+{
+ return foo() != 0;
+}
anon3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash88.C
===================================================================
--- crash88.C (nonexistent)
+++ crash88.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/34397
+
+template struct A
+{
+ typedef A B;
+};
crash88.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: canon-type-7.C
===================================================================
--- canon-type-7.C (nonexistent)
+++ canon-type-7.C (revision 338)
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/39754
+// { dg-do "compile" }
+
+struct Foo {};
+template struct A ;
+template > struct B { } ;
+
+template
+struct D
+{
+ typedef W X;
+ A a ;
+};
+
+template
+struct E
+{
+ B b ;
+};
+E e ;
canon-type-7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array21.C
===================================================================
--- array21.C (nonexistent)
+++ array21.C (revision 338)
@@ -0,0 +1,50 @@
+// PR c++/42447
+
+template
+ void* get(int);
+
+template
+ struct unique_ptr;
+
+template
+ struct unique_ptr<_Tp[]>
+ {
+ typedef int __tuple_type;
+
+ void*
+ get() const
+ { return ::get<0>(_M_t); }
+
+ __tuple_type _M_t;
+ };
+
+template class dynamic_dispatch;
+
+template
+ struct dynamic_dispatch
+ {
+ struct entry { };
+ unique_ptr m_Start;
+
+ template
+ void attach_handler(void (UC::*m)(int&))
+ {
+ entry* p = 0;
+ do {
+ } while(--p != m_Start.get());
+ }
+ };
+
+template
+ class request_dispatcher
+ : private dynamic_dispatch
+ { request_dispatcher(); };
+
+struct file_reader
+{
+ void execute_command(int&);
+};
+
+template <>
+ request_dispatcher::request_dispatcher()
+ { this->attach_handler(&file_reader::execute_command); }
array21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef5.C
===================================================================
--- typedef5.C (nonexistent)
+++ typedef5.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/27572
+// { dg-do compile }
+
+template struct A1; // { dg-error "no type|typedef declaration|default argument" }
+template struct A2; // { dg-error "type|typedef declaration|default argument" }
+template struct A3; // { dg-error "no type|typedef declaration|expected" }
+template struct A4; // { dg-error "typedef declaration|default argument" }
typedef5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo3.C
===================================================================
--- repo3.C (nonexistent)
+++ repo3.C (revision 338)
@@ -0,0 +1,11 @@
+// { dg-options "-frepo -DF='a'" }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+template void f () {}
+template void g () { f(); }
+int main () { g(); }
+
+char c = F;
+
+// { dg-final { cleanup-repo-files } }
repo3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: complit2.C
===================================================================
--- complit2.C (nonexistent)
+++ complit2.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/31038
+// { dg-options "" }
+
+template void foo()
+{
+ int i = (int) { 0 };
+}
+
+template void foo<0>();
+int f();
+
+template void bar()
+{
+ int i = (int) { f() };
+}
+
+template void bar<0>();
complit2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: scope2.C
===================================================================
--- scope2.C (nonexistent)
+++ scope2.C (revision 338)
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Aug 2003
+
+// checked instantiated bases in wrong scope.
+
+class Helper {};
+
+template struct X { };
+
+template class Base
+{
+ protected:
+ typedef Helper H;
+};
+
+template
+struct Derived : Base
+{
+ typedef Base Parent;
+ typedef typename Parent::H H;
+
+ class Nested : public X {};
+
+ Nested m;
+
+ void Foo ();
+};
+
+void Foo (Derived &x)
+{
+ x.Foo ();
+}
scope2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor5.C
===================================================================
--- dtor5.C (nonexistent)
+++ dtor5.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/23287
+
+template struct A
+{
+ int i;
+ ~A();
+};
+
+template void f(A *ap) {
+ ap->~A();
+}
+
+template void g(A *ap) {
+ ap->~B(); // { dg-error "destructor name" }
+}
+
+int main()
+{
+ f(new A);
+ g(new A);
+}
dtor5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload3.C
===================================================================
--- overload3.C (nonexistent)
+++ overload3.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/16870
+
+struct A
+{
+ int operator[](int) const;
+};
+
+template A foo();
+
+A bar(A(*)());
+
+template int baz() { return (bar(&foo<0>))[0]; }
+
+template int baz<0>();
overload3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor8.C
===================================================================
--- ctor8.C (nonexistent)
+++ ctor8.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/28711
+// { dg-do compile }
+// { dg-options "" }
+
+template struct A
+{
+ int x[1][1];
+ A() : x((int[1][]){{0}}) {} // { dg-error "except the first" }
+};
+
+A<0> a;
ctor8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent13.C
===================================================================
--- non-dependent13.C (nonexistent)
+++ non-dependent13.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/26266
+
+template
+struct S;
+
+template
+void f() {
+ if (const int i = 3) {
+ S::j; // { dg-error "incomplete" }
+ }
+}
non-dependent13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: call7.C
===================================================================
--- call7.C (nonexistent)
+++ call7.C (revision 338)
@@ -0,0 +1,19 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/17395
+// { dg-do "compile" }
+
+template struct X { };
+
+void fu(int a, X) { }
+
+template
+void bhar(T a, X) { }
+
+int
+main()
+{
+ int x;
+ X y;
+ fu(x, y);
+ bhar(x, y);
+}
call7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash30.C
===================================================================
--- crash30.C (nonexistent)
+++ crash30.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/19034
+
+template< bool C > struct B
+{
+};
+
+template int foo();
+template int foo1();
+
+template struct bar : public B <(sizeof(foo()) == 1)>
+{
+};
+
+template struct bar1 : public B <(sizeof(foo1()) == 1)>
+{
+};
crash30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr1.C
===================================================================
--- dependent-expr1.C (nonexistent)
+++ dependent-expr1.C (revision 338)
@@ -0,0 +1,29 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jun 2003
+
+// PR c++ 9779. ICE
+
+struct I
+{
+};
+
+void Foo (int);
+namespace std
+{
+ template
+ void Baz (I *x)
+ {
+ Foo (sizeof (I));
+ Foo (sizeof (x));
+ Foo (__alignof__ (I));
+ Foo (__alignof__ (x));
+ Foo (x->~I ()); // { dg-error "" }
+ // Foo (typeid (I));
+ Foo (delete x); // { dg-error "" }
+ Foo (delete[] x); // { dg-error "" }
+ Foo (throw x); // { dg-error "" }
+ }
+
+}
dependent-expr1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef21.C
===================================================================
--- typedef21.C (nonexistent)
+++ typedef21.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/37037
+
+typedef void F(void);
+template struct S
+{
+ static F f;
+};
+template class S;
+template void S::f(void)
+{}
+
typedef21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash13.C
===================================================================
--- crash13.C (nonexistent)
+++ crash13.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt
+
+// PR c++/11076: ICE for invalid access declaration containing typename.
+
+template struct A
+{
+ typedef A B;
+};
+
+template struct C
+{
+ typedef typename A::B X;
+ X::Y; // { dg-error "not a base type" }
+};
+
+C c; // { dg-message "instantiated" }
crash13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype18.C
===================================================================
--- nontype18.C (nonexistent)
+++ nontype18.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/28743
+
+template struct A
+{
+ template void foo();
+};
+
+template template void A<0>::foo() {} // { dg-error "template parameter" }
nontype18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit4.C
===================================================================
--- explicit4.C (nonexistent)
+++ explicit4.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003
+
+// Failed to spot specialization using a template-id expr
+
+template class A {};
+template class R {};
+
+template struct Trait { enum {m = n}; };
+
+template R::m> f(A);
+template <> R::m> f(A) {return R<1>();}
explicit4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: function1.C
===================================================================
--- function1.C (nonexistent)
+++ function1.C (revision 338)
@@ -0,0 +1,27 @@
+// PR c++/38647
+// { dg-do compile }
+
+template struct A {};
+const char func[] = "abc";
+template struct A {}; // { dg-error "cannot appear|is invalid" }
+
+char a1[1];
+A a;
+
+template struct B {};
+template struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid" }
+
+char b1[1];
+B b;
+
+template struct C {};
+template struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid" }
+
+char c1[1];
+C c;
+
+template struct D {};
+template struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid" }
+
+char d1[1];
+D d;
function1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error-recovery1.C
===================================================================
--- error-recovery1.C (nonexistent)
+++ error-recovery1.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/43076
+
+struct S;
+template < typename > struct T
+{
+ template < typename >
+ template < bool > struct T < S > // { dg-error "" }
+ {
+ void f () { // { dg-error "" }
error-recovery1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: invalid1.C
===================================================================
--- invalid1.C (nonexistent)
+++ invalid1.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/14883
+// { dg-options "-std=gnu++98" }
+
+template < class T > struct DomainTraits {};
+template < int Dim > class Interval;
+template < class DT > class Domain {};
+template <> class Interval < 1 >:public Domain < DomainTraits < Interval < 1 >
+>> {}; // { dg-error "" }
invalid1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate6.C
===================================================================
--- instantiate6.C (nonexistent)
+++ instantiate6.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: gianni@mariani.ws
+// Wolfgang Bangerth
+
+// PR c++/13289: ICE recursively instantiate static member data.
+
+template struct S {
+ static const int C;
+};
+
+template
+const int S::C = S<(N+1)%2>::C;
+
+template struct S<1>;
+
instantiate6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend13.C
===================================================================
--- memfriend13.C (nonexistent)
+++ memfriend13.C (revision 338)
@@ -0,0 +1,71 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class template of class template as friend
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template class C {
+ int i;
+ template template friend struct A::B;
+};
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template <> struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A::B b1;
+ b1.f();
+ A::B b2;
+ b2.f();
+ A::B b3;
+ b3.f();
+ A::B b4;
+ b4.f();
+}
memfriend13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend21.C
===================================================================
--- friend21.C (nonexistent)
+++ friend21.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: ajl13@bellatlantic.net
+
+// PR c++/5421: ICE for specialization of member function template
+// as friend.
+
+struct B {
+ template void b();
+};
+
+template class A {
+ friend void B::b();
+};
+
+static A a;
friend21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg5.C
===================================================================
--- defarg5.C (nonexistent)
+++ defarg5.C (revision 338)
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+// Wolfgang Bangerth
+
+// PR c++/17344: Substitution failure is not an error
+// for default template argument
+
+template struct intTraits;
+
+template<> struct intTraits {
+ static const int i = 0;
+};
+
+template::i> struct A {};
+
+struct S {
+ template class X> S(X);
+};
+
+int bar(S);
+int bar(A);
+
+A bed;
+int i = bar(bed);
defarg5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp24.C
===================================================================
--- ttp24.C (nonexistent)
+++ ttp24.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/30897
+
+template class U> struct A
+{
+ template U foo();
+};
ttp24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete1.C
===================================================================
--- incomplete1.C (nonexistent)
+++ incomplete1.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin: Ivan Godard
+// PR c++/17447: Detect parameters of dependent types even in templates
+
+struct B; // { dg-error "forward declaration" }
+template struct A {
+
+ friend A& operator <<(A& a, B b) { return a; } // { dg-error "incomplete" }
+ friend A& operator <<(A& a, T b) { return a; }
+
+ void foo1(B b) {} // { dg-error "incomplete" }
+ void foo1a(T b) {}
+
+ B foo2(void) {} // { dg-error "incomplete" }
+ T foo2a(void) {}
+
+ void foo3(B b);
+};
incomplete1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash97.C
===================================================================
--- crash97.C (nonexistent)
+++ crash97.C (revision 338)
@@ -0,0 +1,24 @@
+// PR c++/44628
+
+template
+class Temp
+{
+ int Val;
+ public:
+ operator T&(void) { return Val; }
+
+ virtual T& operator=(T a ) // { dg-error "overriding" }
+ {
+ Val = a;
+ return Val;
+ }
+};
+
+class Int : public Temp
+{
+ public:
+ Int& operator=(int a) // { dg-error "conflicting return type" }
+ {
+ return (*this);
+ }
+};
crash97.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array13.C
===================================================================
--- array13.C (nonexistent)
+++ array13.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/20208
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" void abort();
+
+template
+inline void *Foo (T arg) { return &arg[0]; }
+
+int main () {
+ int bry[2];
+ if (Foo(bry) != bry)
+ abort();
+}
array13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial6.C
===================================================================
--- partial6.C (nonexistent)
+++ partial6.C (revision 338)
@@ -0,0 +1,31 @@
+// PR c++/41703
+// The second GetAllSize template is more specialized because even though
+// deduction on each parameter type succeeds, we never get a template
+// argument for its X to make it match the first template.
+
+template
+struct TSizeEnabler
+{
+ typedef T TClass;
+};
+
+template
+int
+GetAllSize(const X &Var)
+{ return sizeof(Var); }
+
+template
+int
+GetAllSize(const typename TSizeEnabler::TClass &Var)
+{ return Var.func(); }
+
+struct H
+{
+ int func() const;
+};
+
+int main()
+{
+ H b;
+ return GetAllSize< H >(b);
+}
partial6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent5.C
===================================================================
--- non-dependent5.C (nonexistent)
+++ non-dependent5.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/15299
+
+template void fun_ptr(T (*)());
+template T bar();
+
+template void foo () {
+ fun_ptr(bar);
+}
non-dependent5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qual1.C
===================================================================
--- qual1.C (nonexistent)
+++ qual1.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+template
+class Link_array
+{
+public:
+ void sort (int (*compare) (T *const&,T *const&));
+};
+
+int shift_compare (int *const &, int *const &) {}
+
+template void
+Link_array::sort (int (*compare) (T *const&,T *const&))
+{
+}
+
+void f ()
+{
+ Link_array clashes;
+ clashes.sort (shift_compare);
+}
qual1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access3.C
===================================================================
--- access3.C (nonexistent)
+++ access3.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// PR c++/5387
+// Enforcing access of typename type.
+
+template struct A {
+ typename T::template X x; // { dg-error "this context" }
+};
+
+class B {
+ template class X {}; // { dg-error "private" }
+};
+
+int main()
+{
+ A ab; // { dg-message "instantiated" }
+}
access3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype9.C
===================================================================
--- nontype9.C (nonexistent)
+++ nontype9.C (revision 338)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-prune-output "mangled name" }
+// Contributed by: Giovanni Bajo
+int i;
+
+template
+struct g {
+ void foo(void) {
+ FN ();
+ }
+};
+
+void h ()
+{
+ i = 7;
+}
+
+template struct g;
+
nontype9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv1.C
===================================================================
--- conv1.C (nonexistent)
+++ conv1.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 4361. Template conversion operators were not overloaded.
+
+template struct Second;
+
+template struct First
+{
+ int Foo ();
+
+ template operator Second();
+ template operator First();
+};
+
+template int First::Foo ()
+{} // This is here to make sure we didn't smash Foo's decl in the
+ // method vector
+
+struct B { };
+struct D { };
+
+void Foo ()
+{
+ First (First::*pf)() = &First::operator First;
+}
conv1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash6.C
===================================================================
--- crash6.C (nonexistent)
+++ crash6.C (revision 338)
@@ -0,0 +1,8 @@
+template struct A { static const int n = 1; } ;
+template struct B;
+
+template
+struct restype_order {
+ static const int s = A::n;
+ typedef typename B<(s > 0)>::t t;
+};
crash6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae1.C
===================================================================
--- sfinae1.C (nonexistent)
+++ sfinae1.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/14337
+
+template struct Constraint;
+template <> struct Constraint { typedef int Result; };
+
+template
+struct IsInt { static const bool value = false; };
+
+template <>
+struct IsInt { static const bool value = true; };
+
+template
+typename Constraint::value>::Result foo(T);
+
+template
+typename Constraint::value>::Result foo(T);
+
+template
+void bar() {
+ foo(1);
+}
sfinae1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename16.C
===================================================================
--- typename16.C (nonexistent)
+++ typename16.C (revision 338)
@@ -0,0 +1,25 @@
+// PR37314 rejects-valid, from w.doeringer
+template
+struct A {
+ typedef __PTRDIFF_TYPE__ difference_type;
+ struct B {
+ typedef typename A::difference_type difference_type;
+ difference_type operator-(B const&) const;
+ T t;
+ };
+};
+//
+
+template
+typename A::B::difference_type A::B::operator-(B const&) const {
+ return -1;
+}
+
+//
+int main() {
+ A::B i;
+ ++i.t;
+ return 0;
+}
+
+
typename16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member3.C
===================================================================
--- member3.C (nonexistent)
+++ member3.C (revision 338)
@@ -0,0 +1,19 @@
+template
+struct A {
+ template struct SubA { };
+
+ template void f(T1 & t1, SubA & t2) { }
+ template void g(SubA & suba) { }
+ template void h(SubA & suba) { }
+};
+
+int main(void) {
+ int i;
+ A a;
+ A::SubA suba;
+
+ a.f(i,suba);
+ a.g(suba);
+ a.h(suba);
+}
+
member3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend9.C
===================================================================
--- memfriend9.C (nonexistent)
+++ memfriend9.C (revision 338)
@@ -0,0 +1,63 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class of class template as friend
+
+template struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+class C {
+ int i;
+ template friend struct A::B;
+};
+
+template struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+template<> struct A
+{
+ struct B
+ {
+ void f();
+ };
+};
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A::B b1;
+ b1.f();
+ A::B b2;
+ b2.f();
+ A::B b3;
+ b3.f();
+}
memfriend9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fnspec1.C
===================================================================
--- fnspec1.C (nonexistent)
+++ fnspec1.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/35146
+
+template struct S {};
+
+template struct ref;
+template <> struct ref { typedef double result; };
+
+template
+void foo(typename ref::result, S*);
+template <>
+void foo(S, S*); // { dg-error "does not match" }
+template <>
+void foo(double alpha, S* x)
+{
+ alpha; x;
+}
fnspec1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend9.C
===================================================================
--- friend9.C (nonexistent)
+++ friend9.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+
+// PR c++/8099
+// Partial specialization as friend class
+
+template struct X;
+template struct X<1,T>;
+
+template class Y {
+ static int i;
+ template friend struct X;
+ friend struct X<1,P>;
+};
+
+template struct X<1,T> {
+ X () { Y::i; } // access private field
+};
friend9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access10.C
===================================================================
--- access10.C (nonexistent)
+++ access10.C (revision 338)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// PR c++/10849: Incorrect access checking on template specialization.
+
+class X {
+ private:
+ template struct Y;
+};
+
+template <> struct X::Y {};
+
+template struct X::Y {};
+
+template struct X::Y;
access10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef30.C
===================================================================
--- typedef30.C (nonexistent)
+++ typedef30.C (revision 338)
@@ -0,0 +1,20 @@
+// Origin: PR c++/43206
+// { dg-do compile }
+
+template struct NumericTraits{ typedef A TInputImage;};
+template class CovariantVector{};
+template struct Image{ typedef C PixelType;};
+template
+class F {
+ typedef H G;
+ typedef
+ typename NumericTraits::RealType
+ InputRealType;
+};
+
+template::TInputImage> > >
+class XXX{};
+
+XXX > x;
+
typedef30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: field1.C
===================================================================
--- field1.C (nonexistent)
+++ field1.C (revision 338)
@@ -0,0 +1,12 @@
+struct A {
+ void (*f)(void);
+};
+
+template< typename R >
+struct B : public A {
+ void g()
+ {
+ A::f();
+ }
+};
+template class B;
field1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash22.C
===================================================================
--- crash22.C (nonexistent)
+++ crash22.C (revision 338)
@@ -0,0 +1,26 @@
+// { dg-do compile }
+
+// Origin: Debian GCC maintainers
+// Volker Reichelt
+
+// PR c++/16706: Dependent type calculation during access checking
+
+template struct A
+{
+ A();
+ template struct X {};
+};
+
+template struct B
+{
+ typename A::template X x;
+ template struct C;
+};
+
+template template struct B::C
+{
+ C() {}
+ A a;
+};
+
+template struct B::C;
crash22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef13.C
===================================================================
--- typedef13.C (nonexistent)
+++ typedef13.C (revision 338)
@@ -0,0 +1,16 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/26693
+// { dg-do compile }
+
+class A
+{
+ typedef int mytype; // { dg-error "typedef int A::mytype' is private" }
+};
+
+template class B : public A
+{
+ mytype mem; // { dg-error "within this context" }
+};
+
+B b; // { dg-message "instantiated from here" }
+
typedef13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename2.C
===================================================================
--- typename2.C (nonexistent)
+++ typename2.C (revision 338)
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// { dg-options "" }
+
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2002
+
+// PR 5507. Overzealous implicit typename warning
+
+template
+class __ctype_abstract_base
+{
+ typedef int mask;
+};
+
+template
+class ctype : public __ctype_abstract_base<_CharT>
+{
+ typedef typename ctype::mask mask;
+};
+
+template
+class ctype2 : public __ctype_abstract_base<_CharT>
+{
+ typedef mask mask; // { dg-error "does not name a type" "no type" }
+ // { dg-message "note" "note" { target *-*-* } 24 }
+};
typename2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nested5.C
===================================================================
--- nested5.C (nonexistent)
+++ nested5.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/33959
+
+template struct A
+{
+ struct C
+ {
+ template struct D {};
+ };
+ template static C::D bar (S const &);
+};
+
+struct E {};
+
+int
+main ()
+{
+ E e;
+ A::bar (e);
+}
nested5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member.C
===================================================================
--- member.C (nonexistent)
+++ member.C (revision 338)
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+
+class BIXSet{
+int z[4];
+public:
+void f(BIXSet &other){
+z[0]=other.z[0];
+}
+
+};
+
+class TestCase2{
+public:
+BIXSet a,b;
+
+public:
+void run(void){
+BIXSet x,y;
+process(0,x,y);
+}
+
+protected:
+template void process(const int d,BS &en,BS &lb){
+a.f(en);b.f(lb);
+}
+
+};
member.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend30.C
===================================================================
--- friend30.C (nonexistent)
+++ friend30.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/14930
+
+template class Point;
+
+template<> class Point {
+ friend class Plane;
+ double v;
+};
+
+struct Plane {
+ double get(const Point& p);
+};
+
+double Plane::get(const Point &p) { return p.v; }
+
friend30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend13.C
===================================================================
--- friend13.C (nonexistent)
+++ friend13.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Perform access checking to parameter and return type of
+// function template correctly when only specialization is friend.
+
+template
+typename T::Inner
+foo () {
+ return typename T::Inner();
+}
+
+class Outer {
+ private:
+ struct Inner {};
+
+ friend Outer::Inner foo ();
+};
+
+void f() {
+ foo();
+}
friend13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator2.C
===================================================================
--- operator2.C (nonexistent)
+++ operator2.C (revision 338)
@@ -0,0 +1,8 @@
+template struct A {};
+
+struct B {
+ operator A();
+};
+
+template
+void f() { B::operator A; }
operator2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp16.C
===================================================================
--- ttp16.C (nonexistent)
+++ ttp16.C (revision 338)
@@ -0,0 +1,7 @@
+template class C>
+void f() {}
+
+template
+struct S {};
+
+template void f(); // { dg-error "match" }
ttp16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: anon4.C
===================================================================
--- anon4.C (nonexistent)
+++ anon4.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/28407
+// A declaration in the anonymous namespace still has external linkage.
+
+template class A { };
+namespace
+{
+ int i;
+}
+
+A<&i> a;
anon4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash89.C
===================================================================
--- crash89.C (nonexistent)
+++ crash89.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/34397
+
+template struct A
+{
+ typedef A B;
+};
+
+A a; // { dg-error "subscripted|template|declaration" }
crash89.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef6.C
===================================================================
--- typedef6.C (nonexistent)
+++ typedef6.C (revision 338)
@@ -0,0 +1,8 @@
+//PR c++/28303
+
+template struct A
+{
+ typedef struct typename T::X X; // { dg-error "expected identifier|two or more" }
+};
+
+template A::X::X() {} // { dg-error "not a type|forbids declaration|invalid use of" }
typedef6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28284.C
===================================================================
--- pr28284.C (nonexistent)
+++ pr28284.C (revision 338)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+template struct A
+{
+ static const int i=x; /* { dg-error "was not declared in this scope" } */
+ static const int j, k;
+};
+
+template const int A::j = i;
+template const int A::k = j;
+
+A<0> a;
pr28284.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo4.C
===================================================================
--- repo4.C (nonexistent)
+++ repo4.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/17775
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+namespace {
+ struct Foo {};
+}
+
+template
+void foo(Tp) {}
+
+int
+main()
+{
+ foo(Foo());
+}
repo4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wrap1.C
===================================================================
--- wrap1.C (nonexistent)
+++ wrap1.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Michael Matz 03 Mar 2002
+// instance of an actual pattern in 252.eon from SPEC2000
+
+// The last Wrapper once wasn't completed when applying '='.
+
+template
+class Wrapper {
+ public:
+ Wrapper (T& a);
+ Wrapper (const Wrapper& ref);
+};
+
+template
+class Element {
+public:
+ T * operator[](int x);
+};
+
+void test()
+{
+ char bla = 42;
+ Element< Wrapper > elem;
+ elem[1][1] = Wrapper (bla);
+}
wrap1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify10.C
===================================================================
--- unify10.C (nonexistent)
+++ unify10.C (revision 338)
@@ -0,0 +1,48 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+// and Rene Fonseca
+// PR c++/8271: Check cv-qualifiers while unifying pointer to member
+// functions.
+
+struct MyClass {
+ void mMethod() throw() {}
+ void cMethod() const throw() {}
+ void vMethod() volatile throw() {}
+ void cvMethod() const volatile throw() {}
+};
+
+template
+void mFunction(void (CLASS::* method)()) {}
+
+template
+void cFunction(void (CLASS::* method)() const) {}
+
+template
+void vFunction(void (CLASS::* method)() volatile) {}
+
+template
+void cvFunction(void (CLASS::* method)() const volatile) {}
+
+int main() {
+ mFunction(&MyClass::mMethod);
+ mFunction(&MyClass::cMethod); // { dg-error "no matching function" }
+ mFunction(&MyClass::vMethod); // { dg-error "no matching function" }
+ mFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
+
+ cFunction(&MyClass::mMethod); // { dg-error "no matching function" }
+ cFunction(&MyClass::cMethod);
+ cFunction(&MyClass::vMethod); // { dg-error "no matching function" }
+ cFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
+
+ vFunction(&MyClass::mMethod); // { dg-error "no matching function" }
+ vFunction(&MyClass::cMethod); // { dg-error "no matching function" }
+ vFunction(&MyClass::vMethod);
+ vFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
+
+ cvFunction(&MyClass::mMethod); // { dg-error "no matching function" }
+ cvFunction(&MyClass::cMethod); // { dg-error "no matching function" }
+ cvFunction(&MyClass::vMethod); // { dg-error "no matching function" }
+ cvFunction(&MyClass::cvMethod);
+
+ return 0;
+}
unify10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: scope3.C
===================================================================
--- scope3.C (nonexistent)
+++ scope3.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/41038
+
+struct S
+{
+ int size() const;
+};
+
+template
+struct Packer
+{
+ int foo() {
+ return Packer::var.size();
+ }
+ const S& var;
+};
scope3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor6.C
===================================================================
--- dtor6.C (nonexistent)
+++ dtor6.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/40139
+
+template struct A
+{
+ static int i;
+};
+
+template int A::i = { A::~A }; // { dg-error "non-static member function" }
+
+template class A<0>;
+
+struct X { };
+
+int i1 = X::~X; // { dg-error "non-static member function" }
+int i2 = &X::~X; // { dg-error "address of destructor" }
+int i3 = &A<0>::~A; // { dg-error "address of destructor" }
dtor6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload4.C
===================================================================
--- overload4.C (nonexistent)
+++ overload4.C (revision 338)
@@ -0,0 +1,20 @@
+// PR c++/20679
+
+template
+struct foo
+{
+ struct bar
+ {
+ int m;
+ };
+
+ void m() const {}
+ void m() {}
+
+ bool n() const { return b->m < 42; }
+
+ bar *b;
+};
+
+
+
overload4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ctor9.C
===================================================================
--- ctor9.C (nonexistent)
+++ ctor9.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/9050, DR 147, 318
+
+struct Y
+{
+ template Y (T);
+ template void foo (T);
+};
+
+template <> Y::Y (int) { }
ctor9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash31.C
===================================================================
--- crash31.C (nonexistent)
+++ crash31.C (revision 338)
@@ -0,0 +1,3 @@
+// PR c++/19063
+
+template
crash31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr2.C
===================================================================
--- dependent-expr2.C (nonexistent)
+++ dependent-expr2.C (revision 338)
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003
+
+// PR 11704. ICE
+
+struct A
+{
+ int foo()
+ {
+ return 5;
+ }
+};
+
+template // If B is not template it works
+struct B
+{
+ bool bar(A& a)
+ {
+ return a.foo == 0; // { dg-error "" "" }
+ }
+};
dependent-expr2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef22.C
===================================================================
--- typedef22.C (nonexistent)
+++ typedef22.C (revision 338)
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/14777
+// { dg-do compile }
+
+template
+struct B
+{
+protected:
+ typedef int M; // { dg-error "protected" }
+};
+
+template
+struct A : B {
+ typedef typename B::M N; // { dg-error "context" }
+ A (int = N ());
+};
+
+A a = A ();
typedef22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash14.C
===================================================================
--- crash14.C (nonexistent)
+++ crash14.C (revision 338)
@@ -0,0 +1,3 @@
+template class foo { public: foo() { } class Z { };};
+template void dep7(foo *) { } // { dg-error "" }
+
crash14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: assign1.C
===================================================================
--- assign1.C (nonexistent)
+++ assign1.C (revision 338)
@@ -0,0 +1,15 @@
+// PR c++/16623
+
+template
+struct C
+{
+ C& operator= (int);
+};
+
+template
+C& C::operator= (int)
+{
+ return *this;
+}
+
+C<0> a;
assign1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: nontype19.C
===================================================================
--- nontype19.C (nonexistent)
+++ nontype19.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/42466
+
+template
+struct A
+{
+ A();
+
+ template
+ A(const A& other);
+};
+
+int main(int argc, char** argv)
+{
+ A a;
+ A b = a;
+
+ A c;
+ A d = c;
+}
nontype19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit5.C
===================================================================
--- explicit5.C (nonexistent)
+++ explicit5.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003
+
+// Failed to spot specialization using a template-id expr
+
+template class A {};
+template class R {};
+
+template struct Trait { enum {m = sizeof (n)}; };
+
+template R::m> f(A);
+template <> R::m> f(A) {return R<1>();}
explicit5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error-recovery2.C
===================================================================
--- error-recovery2.C (nonexistent)
+++ error-recovery2.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/43621
+
+template
+class A {
+ template
+ A A::f(); // { dg-error "extra qualification" }
+};
error-recovery2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate7.C
===================================================================
--- instantiate7.C (nonexistent)
+++ instantiate7.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/19498
+// Origin: Volker Reichelt
+// { dg-do compile }
+
+template struct A
+{
+ template struct B; // { dg-error "reference to void" }
+};
+
+A a; // { dg-message "instantiated" }
instantiate7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend14.C
===================================================================
--- memfriend14.C (nonexistent)
+++ memfriend14.C (revision 338)
@@ -0,0 +1,73 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class template of class template as friend
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template class C {
+ int i;
+ template template friend struct A::B;
+};
+
+template struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template<> struct A
+{
+ template struct B
+ {
+ void f();
+ };
+};
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template void A::B::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A::B<'b'>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int d2 = 0;
+
+int main()
+{
+ A::B<0> b1;
+ b1.f();
+ A::B<&d2> b2;
+ b2.f();
+ A::B<'a'> b3;
+ b3.f();
+ A::B<'b'> b4;
+ b4.f();
+}
memfriend14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend22.C
===================================================================
--- friend22.C (nonexistent)
+++ friend22.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Origin: Benoit Hudson
+
+// PR c++/641: Duplicate friend diagnostics
+
+template class iterator { };
+template class item {
+ friend class iterator;
+ friend class iterator;
+};
+
+class A { };
+
+item i;
friend22.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg6.C
===================================================================
--- defarg6.C (nonexistent)
+++ defarg6.C (revision 338)
@@ -0,0 +1,25 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Oct 2005
+
+// PR 21353 missing error.
+// Origin:Andrew Pinski
+
+enum X{ a, b, c };
+
+struct C
+{
+ static void func (X &ref = a); // { dg-error "default argument" "" }
+};
+
+template
+struct D
+{
+ static void func (X &ref = a); // not an error at this point
+};
+
+void Foo (X & obj)
+{
+ D::func (obj);
+
+ D::func (); // { dg-error "default argument" "" }
+}
defarg6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp25.C
===================================================================
--- ttp25.C (nonexistent)
+++ ttp25.C (revision 338)
@@ -0,0 +1,26 @@
+// { dg-do compile }
+template class C>
+void f1(T, C<5>);
+
+template class C>
+void f2(C<5>, T);
+
+template class C>
+void f3(C<5>, T);
+
+template struct metafun { typedef T type; };
+
+template<> struct metafun { typedef int type; };
+
+template::type> class C>
+void f4(T, C<5>);
+
+template struct X {};
+void g() {
+ f1(5l, X<5>()); // { dg-error "no matching" }
+ f2(X<5>(), 5);
+ f3(X<5>(), 5l); // { dg-error "no matching" }
+ f4(5, X<5>());
+ f4(5l, X<5>()); // { dg-error "no matching" }
+ f4((short)5, X<5>());
+}
ttp25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete2.C
===================================================================
--- incomplete2.C (nonexistent)
+++ incomplete2.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/27427
+// { dg-do compile }
+
+struct A;
+
+template void foo();
+
+A a; // { dg-error "incomplete type" }
+
+void bar()
+{
+ foo(); // { dg-error "no matching function" }
+}
incomplete2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash98.C
===================================================================
--- crash98.C (nonexistent)
+++ crash98.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/44039
+
+struct locale { };
+
+template
+ void
+ foo()
+ { locale::locale(); } // { dg-error "cannot call|function-style" }
+
+void
+bar()
+{ foo(); }
crash98.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: subst1.C
===================================================================
--- subst1.C (nonexistent)
+++ subst1.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 16 Sep 2002
+
+// PR 7718. ICE.
+
+template
+void default_initializer(const OBJECT &) { }
+
+
+template
+class cContainer {
+ public:
+ template
+ void Add(const INITIALIZER &initializer) {
+ init_function(initializer);
+ }
+};
+
+int main() {
+ cContainer > c;
+
+ c.Add(42);
+
+ return 0;
+}
subst1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fntry1.C
===================================================================
--- fntry1.C (nonexistent)
+++ fntry1.C (revision 338)
@@ -0,0 +1,43 @@
+// PR c++/26433
+// { dg-do link }
+
+int get_int()
+{
+ throw 1;
+
+ return 0;
+}
+
+template class Test
+{
+public:
+ Test()
+ try
+ : i(get_int())
+ {
+ i++;
+ }
+ catch(...)
+ {
+ // Syntax error caused by undefined __FUNCTION__.
+ const char* ptr = __FUNCTION__;
+ }
+
+private:
+ int i;
+ _T t;
+};
+
+int main()
+{
+ try
+ {
+ Test test;
+ }
+ catch(...)
+ {
+ return 1;
+ }
+
+ return 0;
+}
fntry1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cond.C
===================================================================
--- cond.C (nonexistent)
+++ cond.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/8080
+
+// Bug: the transformation in finish_while_stmt_cond produced something
+// that tsubst_expr handled badly. Fixed by not doing the transformation
+// while parsing a template.
+
+class TObject {};
+
+struct TIter {
+ TObject *operator()();
+};
+
+
+template
+void get_root_object(TIter& iobj) {
+ while ( TObject* pnew_obj = iobj() )
+ ;
+}
+
+void foo(TIter& iobj)
+{
+ get_root_object(iobj);
+}
cond.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array14.C
===================================================================
--- array14.C (nonexistent)
+++ array14.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/23993
+
+const int data[2][4] = {
+ { 0, 1, 2, 3 }
+};
+
+template
+void t(int k) {
+ int candidate = data[1][k];
+}
array14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: partial7.C
===================================================================
--- partial7.C (nonexistent)
+++ partial7.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/43559
+
+template void f(U&) { }
+template void f(T const&) { }
+
+int main()
+{
+ int a;
+ f(a);
+}
partial7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent6.C
===================================================================
--- non-dependent6.C (nonexistent)
+++ non-dependent6.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/15285
+
+void foo(void (*func)()) {}
+
+template
+void bar()
+{}
+
+template
+void baz()
+{
+ foo(&bar);
+}
non-dependent6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qual2.C
===================================================================
--- qual2.C (nonexistent)
+++ qual2.C (revision 338)
@@ -0,0 +1,29 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Jan 2003
+
+// PR9415. Forgot a lookup was scoped
+
+int here;
+int there;
+
+struct B
+{
+ virtual int activate() {return !here++;}
+};
+
+template
+struct TPL : public B
+{
+ int activate()
+ {
+ return !there++ && B::activate();
+ }
+};
+
+int main ()
+{
+ TPL i;
+ return !i.activate ();
+}
qual2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access4.C
===================================================================
--- access4.C (nonexistent)
+++ access4.C (revision 338)
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+
+// PR c++/7347
+// Access control for typename during instantiation
+
+template class Base {
+ protected:
+ typedef int T;
+};
+
+template class D : public Base {
+ public:
+ typedef typename Base::T T1;
+ D (T1 t);
+};
+
+D<2> d(1);
access4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv2.C
===================================================================
--- conv2.C (nonexistent)
+++ conv2.C (revision 338)
@@ -0,0 +1,39 @@
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 4361. Template conversion operators were not overloaded.
+
+class C
+{
+public:
+
+ operator float () {return 2;}
+
+ operator int ()
+ {
+ return 0;
+ }
+
+ template
+ operator int ()
+ { return 1;
+ }
+};
+
+int main ()
+{
+ C p;
+ int r;
+
+ r = p.operator int ();
+ if (r)
+ return r;
+ r = static_cast (p);
+
+ if (r)
+ return r + 2;
+
+ return 0;
+}
conv2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash7.C
===================================================================
--- crash7.C (nonexistent)
+++ crash7.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt
+
+// PR c++/10108: ICE in tsubst_decl for error due to non-existence
+// nested type.
+
+template struct A
+{ // { not-dg-error "candidates" }
+ template A(typename A::X) {} // { dg-error "no type" }
+};
+
+A a; // { not-dg-error "instantiated|no match" }
+// We currently don't give the "no match" error because we don't add the
+// invalid constructor template to TYPE_METHODS.
crash7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae2.C
===================================================================
--- sfinae2.C (nonexistent)
+++ sfinae2.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/19989
+// Don't instantiate a function template if it would generate an
+// array of size zero.
+
+// { dg-do compile }
+
+template struct cl {
+ const static int value = T;
+};
+
+template void fn (char (*) [cl::value] = 0 );
+
+void foo (void)
+{
+ fn<0> (); // { dg-error "no matching function" }
+}
+
sfinae2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename17.C
===================================================================
--- typename17.C (nonexistent)
+++ typename17.C (revision 338)
@@ -0,0 +1,10 @@
+// { dg-do compile }
+
+// This should fail as A::foo<0> is not a typename at all.
+struct A
+{
+ template void foo(int i)
+ {
+ typename A::foo<0>(i1); // { dg-error "" }
+ }
+};
typename17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member4.C
===================================================================
--- member4.C (nonexistent)
+++ member4.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Contributed by Matty T.
+// PR c++/13813 [DR206]: Check semantic constraints of members of
+// non-dependent type at instantiation time.
+
+
+// DR206 explains that this is ill-formed, no diagnostic required. We emit
+// a diagnostic instead.
+class E;
+template < class A > class Z {
+ A a;
+ E e; // { dg-error "incomplete type" }
+};
+
+
+// Nested classes are always dependent names.
+template < class A > class Y {
+ class F;
+ F e; // { dg-bogus "" "nested classes are always dependent, see DR108 and DR224" }
+};
member4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit-args1.C
===================================================================
--- explicit-args1.C (nonexistent)
+++ explicit-args1.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/34950
+
+template struct policy {
+ typedef int unnecessary;
+};
+
+template struct A {
+ typedef int type;
+ typedef typename Policy::unnecessary unused;
+};
+
+template struct S {
+ typedef int type;
+ typedef typename A::type unused;
+};
+
+template typename S::type foo();
+template S >::type foo();
+
+template int def(T);
+const int i = def(foo);
explicit-args1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: shift1.C
===================================================================
--- shift1.C (nonexistent)
+++ shift1.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/18140
+// { dg-options "-std=gnu++98" }
+
+template struct IntHolder {
+ static const int value = N;
+};
+
+template struct ShrIntHolder {
+ static const int value = IntHolder< N>>S >::value;
+};
+
shift1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access11.C
===================================================================
--- access11.C (nonexistent)
+++ access11.C (revision 338)
@@ -0,0 +1,24 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+// Access checking during explicit instantiation.
+
+class A {
+ typedef int X; // { dg-error "private" }
+};
+
+class X {
+ private:
+ template struct Y;
+};
+
+template <> struct X::Y {
+ A::X x; // { dg-error "this context" }
+};
+
+template struct X::Y {
+ typename T::X x; // { dg-error "this context" }
+};
+
+template struct X::Y; // { dg-message "instantiated from here" }
access11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash40.C
===================================================================
--- crash40.C (nonexistent)
+++ crash40.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/22180
+
+struct A {};
+
+template void foo()
+{
+ T::~T(); // { dg-error "member" }
+}
+
+template void foo(); // { dg-message "instantiated" }
crash40.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef31.C
===================================================================
--- typedef31.C (nonexistent)
+++ typedef31.C (revision 338)
@@ -0,0 +1,21 @@
+// Origin: PR c++/43558
+// { dg-do compile }
+
+class Compressible;
+template class Engine;
+template
+class Engine
+{
+ public:
+ typedef T Element_t;
+ //Element_t read(int);
+ T read(int);
+};
+
+template
+T Engine::read(int)
+{
+}
+
+Engine x;
+
typedef31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash23.C
===================================================================
--- crash23.C (nonexistent)
+++ crash23.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/17642
+
+template
+int f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d)
+{
+ for (int d=0; d
crash23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef14.C
===================================================================
--- typedef14.C (nonexistent)
+++ typedef14.C (revision 338)
@@ -0,0 +1,16 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/26693
+// { dg-do compile }
+
+template
+struct A
+{
+ typedef int mytype;
+
+ void
+ foo ()
+ {
+ mytype v = ~static_cast (0);
+ }
+};
+
typedef14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename3.C
===================================================================
--- typename3.C (nonexistent)
+++ typename3.C (revision 338)
@@ -0,0 +1,7 @@
+// { dg-do compile }
+// crash test - PR 7266
+
+template
+struct B {
+ typedef A::C::D E; // { dg-error "" }
+};
typename3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend31.C
===================================================================
--- friend31.C (nonexistent)
+++ friend31.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard
+
+// PR c++/15410: Declaration of friend class template with wrong
+// template parameter.
+
+template struct F; // { dg-message "previous declaration" }
+
+class W
+{
+ template friend class F; // { dg-error "template parameter" }
+ int x; // { dg-error "private" }
+};
+
+template struct F
+{
+ void Look(W& w) { w.x = 3; } // { dg-error "within this context" }
+};
+
+int main()
+{
+ W w;
+ F f;
+ f.Look(w);
+ return 0;
+}
friend31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend14.C
===================================================================
--- friend14.C (nonexistent)
+++ friend14.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// Perform access checking to parameter and return type of
+// function template correctly when the template is friend.
+
+template class O {
+ struct I { I (int); };
+
+ template
+ friend typename O::I f ();
+};
+
+template
+typename O::I f () { return 1; }
+
+struct X {
+ void g() { f(); }
+};
friend14.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator3.C
===================================================================
--- operator3.C (nonexistent)
+++ operator3.C (revision 338)
@@ -0,0 +1,10 @@
+// PR c++/15640
+
+struct A {
+ void foo(void);
+};
+
+template void bar() {
+ A a;
+ a + a.foo; // { dg-error "" }
+}
operator3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: redecl1.C
===================================================================
--- redecl1.C (nonexistent)
+++ redecl1.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/15025
+
+template struct X;
+struct X {}; // { dg-error "" }
redecl1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp17.C
===================================================================
--- ttp17.C (nonexistent)
+++ ttp17.C (revision 338)
@@ -0,0 +1,7 @@
+template class C>
+void f(C) {}
+
+template
+struct S {};
+
+template void f(S); // { dg-error "match" }
ttp17.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef7.C
===================================================================
--- typedef7.C (nonexistent)
+++ typedef7.C (revision 338)
@@ -0,0 +1,15 @@
+// An intermediate version of the fix for c++/19407 broke this example.
+
+struct A
+{
+ typedef struct { int i; } S;
+};
+
+template
+struct B: public A
+{
+ template
+ static S f ();
+};
+
+template struct B;
typedef7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo5.C
===================================================================
--- repo5.C (nonexistent)
+++ repo5.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/25625
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+template< typename T, T N > struct integral_c {
+ static const T value = N;
+ typedef integral_c< T, value + 1 > next;
+};
+template< typename T, T N > T const integral_c< T, N >::value;
+integral_c a;
+
+int main () {}
repo5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify11.C
===================================================================
--- unify11.C (nonexistent)
+++ unify11.C (revision 338)
@@ -0,0 +1,36 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/40684
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+};
+
+template
+typename S::A
+foo (S c, T t, U u)
+{
+}
+
+struct B
+{
+ struct C
+ {
+ template
+ C (U t)
+ {
+ A a;
+ A b = foo (this, a, t); // { dg-error "no matching function" }
+ }
+ } c;
+ B () : c (A ())
+ {
+ }
+};
+
+int
+main ()
+{
+ B f;
+}
+
unify11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor7.C
===================================================================
--- dtor7.C (nonexistent)
+++ dtor7.C (revision 338)
@@ -0,0 +1,22 @@
+// PR c++/40373
+// { dg-compile }
+
+struct A;
+namespace
+{
+ struct A;
+}
+
+struct B {};
+
+template void
+foo (T t)
+{
+ t.~A (); // { dg-error "does not match destructor name" }
+}
+
+void
+bar ()
+{
+ foo (B ()); // { dg-bogus "instantiated from here" "" { xfail *-*-* } }
+}
dtor7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload5.C
===================================================================
--- overload5.C (nonexistent)
+++ overload5.C (revision 338)
@@ -0,0 +1,28 @@
+// PR c++/22621
+
+struct foo {
+ typedef int (*fun)(int);
+
+ static int f(int); // overload between static & non-static
+ int f();
+
+ static int g(int); // non-overloaded static
+};
+
+template
+struct f_obj {
+ // something ..
+};
+
+f_obj<&foo::f> a; // OK
+f_obj b; // OK (note: a and b are of the same type)
+
+int foo::f()
+{
+ f_obj<&foo::f> a; // OK
+ f_obj b; // ERROR: foo::f cannot be a constant expression
+
+ f_obj<&foo::g> c; // OK
+ f_obj d; // OK
+}
+
overload5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access20.C
===================================================================
--- access20.C (nonexistent)
+++ access20.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/29470
+
+template struct B
+{
+ protected:
+ T v; // { dg-error "protected" }
+};
+template struct D : B
+{
+ protected:
+ using B::v;
+};
+int main()
+{
+ D d;
+ d.v = 0; // { dg-error "context" }
+ return 0;
+}
access20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash32.C
===================================================================
--- crash32.C (nonexistent)
+++ crash32.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/19667
+
+struct integral_constant { };
+
+template
+struct is_function : public integral_constant { };
+
+template<>
+struct is_function : public integral_constant { }; // { dg-error "" }
crash32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr3.C
===================================================================
--- dependent-expr3.C (nonexistent)
+++ dependent-expr3.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Origin: jbrandmeyer at users dot sourceforge dot net
+// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
+
+template struct S;
+
+template struct Y : K {
+ int x;
+};
+
+template struct Z {
+ S< (bool)(&static_cast *>(0)->x == 0) > // { dg-error "" }
+ s;
+};
dependent-expr3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef23.C
===================================================================
--- typedef23.C (nonexistent)
+++ typedef23.C (revision 338)
@@ -0,0 +1,25 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/42069
+// { dg-do compile }
+
+struct A
+{
+ static const int N = 0;
+};
+
+template struct B {};
+
+template
+struct C
+{
+ typedef T U;
+ B b;
+};
+
+template
+struct C
+{
+ B b;
+};
+
+C c;
typedef23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash15.C
===================================================================
--- crash15.C (nonexistent)
+++ crash15.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/13310
+
+struct A {};
+
+template void foo()
+{
+ A a;
+ a.foo(); // { dg-error "" }
+}
crash15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit6.C
===================================================================
--- explicit6.C (nonexistent)
+++ explicit6.C (revision 338)
@@ -0,0 +1,8 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Feb 2005
+
+// Origin: Volker Reichelt
+// Bug 19895: ICE on invalid
+
+struct A;
+template A<>::A(); // { dg-error "(not a template)|(explicit qualification)" "" }
explicit6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate8.C
===================================================================
--- instantiate8.C (nonexistent)
+++ instantiate8.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Aug 2005
+
+// PR 22044: ICE
+// Origin: Andrew Pinski
+
+struct no_context {
+ template< class Event > void no_function( const Event & );
+};
+template< class Event, class TransitionContext = no_context,
+void ( TransitionContext::*pTransitionAction )( const Event & ) = &no_context::no_function< Event > >
+struct transition
+{
+ struct EvFlipBit {};
+ typedef transition type;
+};
+
instantiate8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend40.C
===================================================================
--- friend40.C (nonexistent)
+++ friend40.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/24173
+// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
+
+template struct A;
+
+void foo(A<0>);
+
+template struct A
+{
+ friend void foo(A<0>);
+};
+
+void bar()
+{
+ foo(A<0>());
+}
friend40.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify1.C
===================================================================
--- unify1.C (nonexistent)
+++ unify1.C (revision 338)
@@ -0,0 +1,26 @@
+// Test non-type template argument folding.
+// Origin: smacdonald@seimac.com
+
+// { dg-do compile }
+
+template < int I1, int I2 >
+class unit
+{
+public:
+ unit() {}
+ unit( const unit& ) {}
+
+ template< int Q1, int Q2 >
+ unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const {
+ return unit< I1 - Q1, I2 - Q2 >();
+ }
+
+};
+
+int main()
+{
+ const unit<1,0> u1;
+ const unit<2,0> u2;
+
+ unit<-1,0> u3( u1 / u2 );
+}
unify1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend15.C
===================================================================
--- memfriend15.C (nonexistent)
+++ memfriend15.C (revision 338)
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class of class template as friend
+
+template struct A
+{
+ struct B1
+ {
+ };
+ struct B2
+ {
+ void f();
+ };
+};
+
+class C {
+ int i; // { dg-error "private" }
+ template friend struct A::B1;
+};
+
+template void A::B2::f()
+{
+ C c;
+ c.i = 0; // { dg-error "context" }
+}
+
+int main()
+{
+ A::B2 b1;
+ b1.f(); // { dg-message "instantiated" }
+}
memfriend15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend23.C
===================================================================
--- friend23.C (nonexistent)
+++ friend23.C (revision 338)
@@ -0,0 +1,38 @@
+// { dg-do compile }
+
+// Origin: Alexandre Tolmos
+
+// PR c++/11876: Friend of its own class diagnostics
+
+template
+class A
+{
+ friend class A;
+ friend class A;
+protected:
+ T _data;
+ inline A() : _data(0) {}
+ template
+ inline A(const A& r) : _data(r._data) {}
+};
+
+class B : public A
+{
+public:
+ inline B() {}
+ inline B(const B& r) : A(r) {}
+};
+
+class C : public A
+{
+public:
+ inline C() {}
+ inline C(const B& r) : A(r) {}
+};
+
+int main(int, char*[])
+{
+ B b1, b2(b1);
+ C c(b1);
+ return 0;
+}
friend23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg7.C
===================================================================
--- defarg7.C (nonexistent)
+++ defarg7.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/25337
+
+template T& MakeT();
+template ().operator[](0))>
+struct helper{};
+template
+static char is_here(helper*);
defarg7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr35240.C
===================================================================
--- pr35240.C (nonexistent)
+++ pr35240.C (revision 338)
@@ -0,0 +1,12 @@
+// PR c++/35240
+// { dg-do compile }
+
+
+template struct A {};
+
+template A foo(); // { dg-message "unimplemented" }
+
+void bar()
+{
+ foo<1>(); // { dg-message "instantiated" }
+}
pr35240.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp26.C
===================================================================
--- ttp26.C (nonexistent)
+++ ttp26.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/34052
+template class C; // { dg-error "no default argument" }
+
+template class C> struct X; // { dg-error "no default argument" }
+
ttp26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete3.C
===================================================================
--- incomplete3.C (nonexistent)
+++ incomplete3.C (revision 338)
@@ -0,0 +1,5 @@
+// PR c++/27315
+// { dg-do compile }
+
+struct A; // { dg-error "forward declaration" }
+template void A::foo<0>(); // { dg-error "before|incomplete" }
incomplete3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array15.C
===================================================================
--- array15.C (nonexistent)
+++ array15.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/28595
+
+template struct A
+{
+ static const int i;
+};
+
+template struct B
+{
+ char c[A::i], d; // { dg-error "constant" }
+};
+
+B<0> b;
array15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent7.C
===================================================================
--- non-dependent7.C (nonexistent)
+++ non-dependent7.C (revision 338)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// PR c++/13092: ICE taking address of member which is non-dependent
+
+struct S
+{
+ int i;
+};
+
+template
+struct X
+{};
+
+template
+struct Foo
+{
+ X<&S::i> x;
+};
+
+template struct Foo;
non-dependent7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem1.C
===================================================================
--- ptrmem1.C (nonexistent)
+++ ptrmem1.C (revision 338)
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Dec 2001
+
+// PR 3716 tsubsting a pointer to member function did not create a
+// pointer to member function.
+
+template
+struct Closure
+{
+ T operator() (C & c) const { return (c.*M); }
+};
+
+template
+struct Closure
+{
+ T operator()(C & c) const { return (c.*M)(); }
+};
+
+struct A
+{
+ int get();
+};
+
+static Closure get_closure;
+
+
+void Foo ()
+{
+ A a;
+ get_closure (a);
+}
ptrmem1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access5.C
===================================================================
--- access5.C (nonexistent)
+++ access5.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// Origin: Wolfgang Bangerth
+
+// PR c++/7348
+// Access control for typename in function return type
+
+class Outer {
+ template struct Inner {
+ typedef int T;
+ T foo ();
+ };
+ public:
+ Outer();
+};
+
+template
+typename Outer::Inner::T Outer::Inner::foo () {
+ return 1;
+}
+
+template struct Outer::Inner<2>;
access5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using10.C
===================================================================
--- using10.C (nonexistent)
+++ using10.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/22136
+
+struct B {
+ void foo();
+};
+
+template class I : public B {};
+
+template class D : private I {
+ I::B::foo;
+};
using10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv3.C
===================================================================
--- conv3.C (nonexistent)
+++ conv3.C (revision 338)
@@ -0,0 +1,43 @@
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 4361. Template conversion operators were not overloaded.
+
+template struct C
+{
+ operator T ()
+ {
+ return 0;
+ }
+ template operator T2 ()
+ {
+ return 1;
+ }
+ int Foo ()
+ {
+ return operator T ();
+ }
+ template int Baz ()
+ {
+ return static_cast (operator T2 ());
+ }
+};
+
+int main ()
+{
+ int r;
+ C c;
+
+ r = c.Foo ();
+ if (r)
+ return 1;
+ r = c.Baz ();
+ if (r)
+ return 2;
+ r = c.Baz ();
+ if (!r)
+ return 3;
+ return 0;
+}
conv3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash8.C
===================================================================
--- crash8.C (nonexistent)
+++ crash8.C (revision 338)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: David Robinson
+
+// PR c++/11513: ICE due to incorrect decision whether the tag is template.
+
+template
+struct bar
+{
+ struct foo
+ {
+ int a;
+ };
+
+ template
+ int wom(U c)
+ {
+ struct foo b;
+ }
+};
crash8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr39425.C
===================================================================
--- pr39425.C (nonexistent)
+++ pr39425.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/39425
+// { dg-do compile }
+
+class a {
+
+ template
+ struct _rec {
+ static const char size = _rec< (s >> 1) >::size;
+ };
+
+ template<> // { dg-error "explicit" }
+ struct _rec <0> {
+ static const char size = 0;
+ };
+
+ static const unsigned int value = _rec < 1 >::size;
+
+} // { dg-error "unqualified-id" }
pr39425.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae3.C
===================================================================
--- sfinae3.C (nonexistent)
+++ sfinae3.C (revision 338)
@@ -0,0 +1,17 @@
+// PR c++/24671
+// { dg-do compile }
+
+template struct A
+{
+ typedef int X;
+ static const int i = 0;
+};
+
+template struct B
+{
+ B(const B&);
+ typedef typename A::i]>::X Y; // { dg-error "forbids zero-size array" }
+ template B(T, Y);
+};
+
+B b(0,0); // { dg-message "instantiated from here" }
sfinae3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error10.C
===================================================================
--- error10.C (nonexistent)
+++ error10.C (revision 338)
@@ -0,0 +1,71 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++98" }
+// Origin:
+// c++/9154: poor error message for ">>" vs "> >" in template argument list
+
+
+/*
+ * Test that the error message is issued properly
+ */
+template
+class A {};
+
+A> blah; // { dg-error "should be '> >' within" }
+A> blah2; // { dg-error "spurious '>>'" }
+
+
+/*
+ * Test that a few valid constructs containing a ">>" token in a
+ * template argument list are handled correctly.
+ */
+template
+void B(void) {}
+
+int Btest()
+{
+ B<256 >> 4>();
+}
+
+template >4>
+struct C {};
+
+template struct D {};
+template struct E {};
+
+E>2 > > E1;
+
+const int x = 0;
+E>x > > E2;
+
+template struct F {
+ typedef int I;
+};
+
+template >2 >::I>
+struct G {};
+
+/*
+ * In this special case, a valid type-id (H() is a function type) is followed
+ * by '>>', but the argument should still be parsed as an expression, which
+ * will then be rejected as non-constant expression.
+ */
+struct H
+{
+ int operator >>(int);
+};
+
+template struct L {};
+L> 5> l; // { dg-error "" "non-constant" }
+
+
+/*
+ * This case used to not emit the nice error message because of a typo
+ * in the code.
+ */
+template
+struct K {};
+
+void KFunc(void);
+
+A> k1; // { dg-error "" }
+K<&KFunc>> k2; // { dg-error "" }
error10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename18.C
===================================================================
--- typename18.C (nonexistent)
+++ typename18.C (revision 338)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// These typename should work as they are types.
+struct A
+{
+ typedef int a;
+ template
+ struct f {};
+ template void foo(int i)
+ {
+ typename A::a(i1);
+ typename A::f<0>(i2);
+ }
+};
typename18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member5.C
===================================================================
--- member5.C (nonexistent)
+++ member5.C (revision 338)
@@ -0,0 +1,33 @@
+// { dg-do compile }
+// Contributed by:
+// PR c++/14389: Disambiguate overloaded member templates which differ only
+// in the template argument list.
+
+namespace N1 {
+
+struct S {
+ template< typename B, typename A > void foo();
+ template< typename A > void foo();
+};
+
+template< typename A > void S::foo() {}
+template< typename B, typename A > void S::foo() {}
+
+template void S::foo ();
+template void S::foo ();
+
+}
+
+namespace N2 {
+
+struct S {
+ template< typename _A > void foo();
+ template< int _i > void foo();
+};
+
+template< typename _A > void S::foo() {}
+
+template void S::foo< 0 >(); // { dg-error "no definition available" "no def" }
+ // { dg-message "instantiated" "instantiated" { target *-*-* } 30 }
+
+}
member5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit-args2.C
===================================================================
--- explicit-args2.C (nonexistent)
+++ explicit-args2.C (revision 338)
@@ -0,0 +1,44 @@
+// PR c++/37177
+// { dg-options -std=c++0x }
+
+#include
+
+namespace N1
+{
+ template bool foo();
+}
+
+struct S
+{
+ template
+ static bool foo();
+
+ template
+ bool bar();
+};
+
+template bool foo();
+
+int main()
+{
+ (void)(&S::bar);
+ decltype(&S::bar) a;
+ typeid(&S::bar);
+
+ (void*)(&S::foo);
+ (void)(&S::foo);
+ decltype(&S::foo) b;
+ typeid(&S::foo);
+
+ (void*)(&N1::foo);
+ (void)(&N1::foo);
+ decltype(&N1::foo) c;
+ typeid(&N1::foo);
+
+ (void*)(&foo);
+ (void)(&foo);
+ decltype(&foo) d;
+ typeid(&foo);
+
+ &foo == 0;
+}
explicit-args2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access12.C
===================================================================
--- access12.C (nonexistent)
+++ access12.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// PR c++/10849: Incorrect access checking on class template partial
+// specialization.
+
+class X {
+ private:
+ template struct Y;
+};
+
+template struct X::Y {};
access12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash41.C
===================================================================
--- crash41.C (nonexistent)
+++ crash41.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/22464
+
+template
+void do_something(const T* A) // { dg-error "declared" }
+{
+ struct helper_t{
+ helper_t() {
+ A[0]; // { dg-error "use" }
+ }
+ } helper;
+}
+
+void sub1() {
+ double A[7];
+ do_something (A);
+}
+
+
crash41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef32.C
===================================================================
--- typedef32.C (nonexistent)
+++ typedef32.C (revision 338)
@@ -0,0 +1,46 @@
+// Origin: PR c++/43704
+// { dg-do compile }
+
+template
+struct if_
+{
+ typedef T2 type;
+};
+
+template
+struct iterator_restrict_traits
+{
+ struct iterator_category {};
+};
+
+template
+struct matrix
+{
+ struct ci {struct ic {};};
+ class i {};
+};
+
+template
+struct triangular_adaptor
+{
+ typedef typename if_::type ty1;
+ class iterator2 : iterator_restrict_traits::iterator_category
+ {
+ };
+};
+
+template
+struct banded_adaptor
+{
+ typedef typename if_::type ty1;
+ class iterator1 : iterator_restrict_traits::iterator_category
+ {
+ };
+};
+
+template
+struct singular_decomposition
+{
+ banded_adaptor >::iterator1 it1;
+};
+
typedef32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash24.C
===================================================================
--- crash24.C (nonexistent)
+++ crash24.C (revision 338)
@@ -0,0 +1,14 @@
+// PR c++/17826
+
+struct A
+{
+ template static int foo();
+};
+
+template struct B {};
+
+template void bar()
+{
+ B()> b1;
+ B()> b2;
+}
crash24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef15.C
===================================================================
--- typedef15.C (nonexistent)
+++ typedef15.C (revision 338)
@@ -0,0 +1,25 @@
+// Contributed by Dodji Seketeli
+// Origin: PR c++/26693
+// { dg-do compile }
+
+template struct C0;
+
+struct Foo {
+ typedef int TypedefedFoo;
+ typedef C0 TypedefedC0;
+};
+
+template
+struct C0
+{
+ typedef Foo TypedefedFoo;
+ typename T::TypedefedC0::TypedefedFoo m;
+};
+
+template
+struct C1
+{
+ typedef C0 TypedefedC0;
+};
+
+C0 > c;
typedef15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename4.C
===================================================================
--- typename4.C (nonexistent)
+++ typename4.C (revision 338)
@@ -0,0 +1,3 @@
+struct B { template struct C; };
+template struct A { typedef typename T::C V; }; // { dg-error "not a type" }
+void f () { A::V p; } // { dg-message "instantiated" }
typename4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: new1.C
===================================================================
--- new1.C (nonexistent)
+++ new1.C (revision 338)
@@ -0,0 +1,45 @@
+// { dg-do run }
+// { dg-options "-O2" }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Dec 2004
+
+// PR 18318. ICE with template new[]
+// Origin:Elliot Hughes
+// Andrew Pinski
+
+struct Aint
+{
+ ~Aint ();
+ Aint ();
+};
+
+Aint::Aint () {}
+Aint::~Aint () {}
+
+static int count;
+
+template
+struct A
+{
+ unsigned Blksize() const;
+
+ void f()
+ {
+ new T[Blksize()];
+ }
+};
+
+template unsigned A::Blksize () const
+{
+ count++;
+ return 1;
+}
+
+int main ()
+{
+ A a;
+ a.f();
+
+ return count != 1;
+}
new1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend32.C
===================================================================
--- friend32.C (nonexistent)
+++ friend32.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Steven Bosscher
+// Serge Belyshev
+
+// PR c++/18825: ICE member as friend
+
+template class A
+{
+ void f (); // { dg-error "private" }
+};
+
+template class B
+{
+ friend void A::f (); // { dg-error "this context" }
+};
+
+int f ()
+{
+ B b; // { dg-message "instantiated" }
+}
friend32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend15.C
===================================================================
--- friend15.C (nonexistent)
+++ friend15.C (revision 338)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/9453
+// Access checking when template friend is defined in class.
+
+template class X {
+ private:
+ struct Inner;
+
+ template
+ friend typename X::Inner * foo () { return 0; }
+};
+template class X;
+
+struct U {
+ void bar () { foo (); }
+};
friend15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: operator4.C
===================================================================
--- operator4.C (nonexistent)
+++ operator4.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/17068
+
+struct A
+{
+ template void operator()() {}
+};
+
+template void foo()
+{
+ A().template operator()<0>();
+}
operator4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: redecl2.C
===================================================================
--- redecl2.C (nonexistent)
+++ redecl2.C (revision 338)
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+// Origin: heinlein@informatik.uni-ulm.de
+
+// PR c++/14428: Redeclaration of class template with wrong
+// non-type template parameter.
+
+template struct X; // { dg-error "template parameter" }
+template struct X; // { dg-error "redeclared here" }
redecl2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp18.C
===================================================================
--- ttp18.C (nonexistent)
+++ ttp18.C (revision 338)
@@ -0,0 +1,10 @@
+template class T>
+void f(T) {}
+
+template
+union U {};
+
+void g() {
+ f(U());
+}
+
ttp18.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init1.C
===================================================================
--- init1.C (nonexistent)
+++ init1.C (revision 338)
@@ -0,0 +1,10 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/9457: ICE tsubst'ing initializers in templates.
+
+template void foo (int count) {
+ int i = {count};
+}
+template void foo (int);
init1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static10.C
===================================================================
--- static10.C (nonexistent)
+++ static10.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/19555
+
+namespace __gnu_debug_def { }
+namespace std
+{
+ using namespace __gnu_debug_def;
+ template class allocator {};
+}
+namespace __gnu_debug_def
+{
+ template >
+ class vector
+ {
+ void
+ swap(vector<_Tp,_Allocator>& __x);
+ };
+}
+namespace std
+{
+ template<> void
+ vector >::swap(vector >&) { } // { dg-error "" }
+}
static10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef8.C
===================================================================
--- typedef8.C (nonexistent)
+++ typedef8.C (revision 338)
@@ -0,0 +1,21 @@
+// PR c++/34206
+
+template struct pair { };
+template struct tuple {
+ template
+ tuple& operator=(const pair& k) { }
+};
+template inline tuple tie(T1& t1, T2& t2) { }
+
+template struct A
+{
+ typedef T type;
+ pair f();
+};
+
+void g(A a)
+{
+ typedef A::type type;
+ type begin1, end1;
+ tie(begin1, end1) = a.f();
+}
typedef8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: recurse1.C
===================================================================
--- recurse1.C (nonexistent)
+++ recurse1.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/5050
+// Origin: georg.wild@gmx.de
+// Reduced by: tbagot@bluearc.com and Nathanael C. Nerode
+// Test for that excessive template recursion does not occur
+// because of optimization.
+// { dg-options "-ftemplate-depth-1 -O" }
+
+ struct ostream {
+ template ostream& foo( const T & )
+ { return *this; }
+ };
+
+ void foo() {
+ ostream os;
+ (os.foo(1)).foo(2);
+ }
recurse1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: qualttp10.C
===================================================================
--- qualttp10.C (nonexistent)
+++ qualttp10.C (revision 338)
@@ -0,0 +1,13 @@
+// Copyright (C) 2001 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+// { dg-do compile }
+
+template class TT> class C {
+};
+
+template struct D {
+ template class B {};
+ C::template B> c;
+};
+
+D d;
qualttp10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: repo6.C
===================================================================
--- repo6.C (nonexistent)
+++ repo6.C (revision 338)
@@ -0,0 +1,26 @@
+// PR c++/34178
+// { dg-options "-frepo" }
+// { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+
+template
+class A
+{
+private:
+ static const int x;
+ static int y;
+
+public:
+ int getX () { return x + y; }
+};
+
+template const int A::x = 0;
+template int A::y = 0;
+
+int
+main ()
+{
+ A a;
+ return a.getX();
+}
repo6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec10.C
===================================================================
--- spec10.C (nonexistent)
+++ spec10.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do run }
+
+// Origin: Lynn Akers
+
+// PR c++/10940: Problem handling parameter list for static member
+// that is a specialization of a member template of a template class.
+
+template
+class o
+{
+public:
+ template static void do_add(T* p, T v);
+};
+
+template<>
+template
+inline void o<32>::do_add(T* p, T v)
+{
+ *p += v;
+}
+
+int main()
+{
+ int a = 0x1000;
+ o<32>().do_add(&a, 0x2000);
+ return (a != 0x3000);
+}
spec10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ref1.C
===================================================================
--- ref1.C (nonexistent)
+++ ref1.C (revision 338)
@@ -0,0 +1,4 @@
+// { dg-prune-output "mangled name" }
+class a {} a1;
+template class b { public: b() { static_cast (p); } };
+int main() { b b1; }
ref1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dtor8.C
===================================================================
--- dtor8.C (nonexistent)
+++ dtor8.C (revision 338)
@@ -0,0 +1,23 @@
+// PR c++/43648
+
+namespace dealii
+{
+ namespace FEValuesViews
+ {
+ template struct Scalar {};
+ }
+
+ template
+ struct X
+ {
+ FEValuesViews::Scalar scalars[dim*spacedim];
+
+ void f()
+ {
+ typedef dealii::FEValuesViews::Scalar ScalarView;
+ scalars[0].ScalarView::~ScalarView ();
+ }
+ };
+
+ template struct X<2,2>;
+}
dtor8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: overload6.C
===================================================================
--- overload6.C (nonexistent)
+++ overload6.C (revision 338)
@@ -0,0 +1,17 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Oct 2005
+
+// PR 21592:ICE
+// Origin: Volker Reichelt
+
+template void unique(T,T);
+
+struct A
+{
+ int begin();
+};
+
+template void foo()
+{
+ unique(A().begin); // { dg-error "no matching function" "" }
+}
overload6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr4926-1.C
===================================================================
--- pr4926-1.C (nonexistent)
+++ pr4926-1.C (revision 338)
@@ -0,0 +1,18 @@
+// PR c++/4926
+// { dg-do compile }
+
+template struct X { typedef int Type; };
+template struct Y { char array[1]; };
+
+template Y P(T); // acts as "Y"
+
+struct F { int operator()() const; };
+
+template
+typename X::Type foo();
+
+void
+bar ()
+{
+ foo();
+}
pr4926-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash50.C
===================================================================
--- crash50.C (nonexistent)
+++ crash50.C (revision 338)
@@ -0,0 +1,7 @@
+// PR c++/27398
+// { dg-do compile }
+
+struct A
+{
+ template void* foo(; // { dg-error "primary-expression|initialization|static" }
+};
crash50.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash33.C
===================================================================
--- crash33.C (nonexistent)
+++ crash33.C (revision 338)
@@ -0,0 +1,8 @@
+// PR c++/19253
+
+namespace N {}
+
+template struct A
+{
+ A > a; // { dg-error "" }
+};
crash33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: dependent-expr4.C
===================================================================
--- dependent-expr4.C (nonexistent)
+++ dependent-expr4.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// Origin: jbrandmeyer at users dot sourceforge dot net
+// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
+// Or, more specifically OFFSETOF.
+
+template struct S;
+
+template struct Y {
+ int x;
+};
+
+template struct Z {
+ S< (bool)(__builtin_offsetof (Y*, x) == 0) >
+ s;
+};
dependent-expr4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typedef24.C
===================================================================
--- typedef24.C (nonexistent)
+++ typedef24.C (revision 338)
@@ -0,0 +1,33 @@
+// Contributed by Dodji Seketeli
+// Origin PR c++/42225
+// { dg-do compile }
+
+template
+struct A
+{
+ typedef T I;
+};
+
+template
+struct B
+{
+ typedef T TT;
+ typedef typename TT::I TT_I;
+ typedef A TA;
+};
+
+template
+void
+foo()
+{
+ typedef T TT;
+ typedef typename TT::I TT_I;
+ typedef A TA;
+}
+
+int
+main()
+{
+ foo >();
+}
+
typedef24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash16.C
===================================================================
--- crash16.C (nonexistent)
+++ crash16.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Alexander Stippler
+// PR c++/10079
+
+template struct A {};
+
+template struct B
+{
+ enum { e };
+};
+
+template A<(B::e && 0)> foo(T) {}
+
+template void foo(B) {}
+
+void bar()
+{
+ B b;
+ foo(b);
+}
crash16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit7.C
===================================================================
--- explicit7.C (nonexistent)
+++ explicit7.C (revision 338)
@@ -0,0 +1,13 @@
+// PR c++/22263
+// { dg-do link }
+
+template struct S { T foo (); T bar (); };
+template T S::foo () { return bar (); }
+template struct S;
+template T S::bar () { return T (); }
+
+#if !__GXX_WEAK__
+template int S::bar ();
+#endif
+
+int main () { return S().foo (); }
explicit7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate9.C
===================================================================
--- instantiate9.C (nonexistent)
+++ instantiate9.C (revision 338)
@@ -0,0 +1,15 @@
+/* PR c++/14622. The invalid explicit instantiation was not reported. */
+/* { dg-do "compile" } */
+template
+class A
+{
+ static T a;
+};
+
+template
+T A::a;
+
+struct B {};
+
+template B A::a; /* { dg-error "does not match declared type" } */
+template float A::a;
instantiate9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend41.C
===================================================================
--- friend41.C (nonexistent)
+++ friend41.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/26912
+
+struct Foo {
+ template int func() const;
+};
+
+class Bar {
+ friend int Foo::func() const;
+};
+
+
friend41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: unify2.C
===================================================================
--- unify2.C (nonexistent)
+++ unify2.C (revision 338)
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+template void f1 (char [][I+1]) {}
+template void f2 (char [][I+0]) {}
+template void f3 (char [][I]) {}
+template void f4 (char [][I-0]) {}
+template void f5 (char [][I-1]) {}
+
+template void f1 (char [][6]); // { dg-error "does not match" }
+template void f2 (char [][6]); // { dg-error "does not match" }
+template void f3 (char [][6]);
+template void f4 (char [][6]); // { dg-error "does not match" }
+template void f5 (char [][6]); // { dg-error "does not match" }
unify2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memfriend16.C
===================================================================
--- memfriend16.C (nonexistent)
+++ memfriend16.C (revision 338)
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Nested class of class template as friend
+
+template struct A
+{
+ template struct B1
+ {
+ };
+ template struct B2
+ {
+ void f();
+ };
+};
+
+class C {
+ int i; // { dg-error "private" }
+ template template friend struct A::B1;
+};
+
+template template void A::B2::f()
+{
+ C c;
+ c.i = 0; // { dg-error "context" }
+}
+
+int main()
+{
+ A::B2 b1;
+ b1.f(); // { dg-message "instantiated" }
+}
memfriend16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend24.C
===================================================================
--- friend24.C (nonexistent)
+++ friend24.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth
+
+// PR c++/495: Fail to locate primary class template that is
+// injected by friend declaration.
+
+template struct X
+{
+ template friend struct Y;
+};
+
+X<2> x;
+
+template struct Y
+{
+ void f (Y);
+ void g (Y);
+};
+
+template void Y::f (Y)
+{
+}
+
+template void Y::g (Y)
+{
+}
friend24.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: defarg8.C
===================================================================
--- defarg8.C (nonexistent)
+++ defarg8.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/27094
+// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
+
+struct A
+{
+ ~A();
+};
+
+struct B : A
+{
+ B();
+};
+
+template struct C
+{
+ C(const B& = B());
+};
+
+C<0> c;
defarg8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp27.C
===================================================================
--- ttp27.C (nonexistent)
+++ ttp27.C (revision 338)
@@ -0,0 +1,6 @@
+// PR c++/35678
+
+template struct A;
+template struct B;
+template class U> struct B > {};
+B > x;
ttp27.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: incomplete4.C
===================================================================
--- incomplete4.C (nonexistent)
+++ incomplete4.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/33501
+// { dg-do compile }
+
+class A; // { dg-error "forward declaration" }
+
+template struct X
+{
+ static int f (T);
+ static const T &make ();
+};
+
+int
+main ()
+{
+ return X::f (X::make ()); // { dg-error "invalid use of incomplete type|initializing argument" }
+}
incomplete4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inherit2.C
===================================================================
--- inherit2.C (nonexistent)
+++ inherit2.C (revision 338)
@@ -0,0 +1,19 @@
+// PR c++/5658
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Theodore.Papadopoulo 11 Feb 2002
+
+struct A {
+ typedef int iterator;
+};
+template
+struct B: public A {
+ template
+ struct iterator {
+ };
+ B() { }
+};
+int main()
+{
+ B a;
+}
inherit2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: array16.C
===================================================================
--- array16.C (nonexistent)
+++ array16.C (revision 338)
@@ -0,0 +1,9 @@
+// PR c++/28886
+
+template struct A;
+
+template struct A {};
+
+template struct A {};
+
+A a;
array16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: non-dependent8.C
===================================================================
--- non-dependent8.C (nonexistent)
+++ non-dependent8.C (revision 338)
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo
+
+// Two-phase name lookup for address of member:
+// Detecting error during parsing
+
+struct S
+{
+ char i;
+};
+
+template
+struct X
+{};
+
+template
+struct Foo
+{
+ X<&S::i> x; // { dg-error "convert|no type" }
+};
non-dependent8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: fntype1.C
===================================================================
--- fntype1.C (nonexistent)
+++ fntype1.C (revision 338)
@@ -0,0 +1,26 @@
+bool f(int i) { return i != 5; }
+
+template
+struct Traits
+{
+ typedef P type;
+};
+
+template ::type>
+struct S
+{
+ const P& p_;
+ S( const P& p ) : p_(p) {} // const reference
+};
+
+template
+S make_s(const typename Traits::type & p) // const reference
+{
+ return S(p); // << HERE
+}
+
+
+int main()
+{
+ make_s(f);
+}
fntype1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ptrmem2.C
===================================================================
--- ptrmem2.C (nonexistent)
+++ ptrmem2.C (revision 338)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Dec 2001
+
+// We'd tsubst a pointer to member reference
+
+struct A {};
+
+template T A::* Foo ();
+
+void Baz ()
+{
+ Foo (); // { dg-error "no matching function" "" }
+}
ptrmem2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: access6.C
===================================================================
--- access6.C (nonexistent)
+++ access6.C (revision 338)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// Origin: Detlef Vollmann
+
+// PR c++/8389
+// Access control ICE for typename during instantiation and name mangling
+
+template class Base {
+ protected:
+ typedef int Type;
+};
+
+template struct Derived : public Base {
+ typedef typename Base::Type Type;
+ template void f(Type = Type()) {}
+};
+
+template void Derived::f (Type);
access6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin1.C
===================================================================
--- builtin1.C (nonexistent)
+++ builtin1.C (revision 338)
@@ -0,0 +1,11 @@
+// PR c++/26559
+
+template struct cond;
+
+template struct S {
+ void f(int i) {
+ cond<__builtin_constant_p(i)>();
+ }
+};
+
+S<1> s;
builtin1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: using11.C
===================================================================
--- using11.C (nonexistent)
+++ using11.C (revision 338)
@@ -0,0 +1,8 @@
+struct X {
+ void f();
+};
+
+template
+struct S : public T {
+ using X::f;
+};
using11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: conv4.C
===================================================================
--- conv4.C (nonexistent)
+++ conv4.C (revision 338)
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2001
+
+// PR 4361. Template conversion operators were not overloaded.
+
+struct C
+{
+ template operator T2 ()
+ {
+ return 1;
+ }
+ int Foo ()
+ {
+ return operator int ();
+ }
+};
+
+struct D
+{
+ int Foo ()
+ {
+ return operator int (); // { dg-error "not defined" "" }
+ }
+};
+
conv4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: crash9.C
===================================================================
--- crash9.C (nonexistent)
+++ crash9.C (revision 338)
@@ -0,0 +1,12 @@
+struct A { };
+struct B { };
+
+A f(const B & b) {
+ return A();
+}
+
+template<>
+B f(const A & a) { // { dg-error "" }
+ return B();
+}
+
crash9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sfinae4.C
===================================================================
--- sfinae4.C (nonexistent)
+++ sfinae4.C (revision 338)
@@ -0,0 +1,35 @@
+// DR 339
+//
+// Test of the use of free functions with SFINAE
+void foo(int) { }
+template void foo(T*) { }
+
+typedef char yes_type;
+struct no_type { char data[2]; };
+
+template T create_a();
+
+template struct enable_if { typedef T type; };
+template struct enable_if { };
+
+template
+ typename enable_if<(sizeof(foo(create_a()), 1) > 0),
+ yes_type>::type
+ check_has_foo(const volatile T&);
+
+no_type check_has_foo(...);
+
+template
+struct has_foo
+{
+ static const bool value =
+ (sizeof(check_has_foo(create_a())) == sizeof(yes_type));
+};
+
+struct X { };
+
+int a1[has_foo::value? 1 : -1];
+int a2[has_foo::value? 1 : -1];
+int a3[has_foo::value? 1 : -1];
+int a4[has_foo::value? -1 : 1];
+int a5[has_foo::value? -1 : 1];
sfinae4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: error11.C
===================================================================
--- error11.C (nonexistent)
+++ error11.C (revision 338)
@@ -0,0 +1,4 @@
+// PR c++/12132
+
+inline template void foo () {} // { dg-error "<" }
+void abort (); // { dg-error ";" }
error11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: member6.C
===================================================================
--- member6.C (nonexistent)
+++ member6.C (revision 338)
@@ -0,0 +1,16 @@
+// PR c++/29105
+
+struct Observer
+{
+ template < typename T > void observeComponent ();
+};
+
+template < typename T >
+struct TagFilter : Observer
+{
+ TagFilter ()
+ {
+ observeComponent < int > ();
+ }
+};
+
member6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.