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: friend33.C
===================================================================
--- friend33.C (nonexistent)
+++ friend33.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do link }
+// { dg-options "-g" }
+
+template
+struct S1
+{
+ struct SS1
+ {
+ };
+ friend void Foo (const SS1& ss1)
+ {
+ }
+};
+
+template
+void Foo(const S1& s1)
+{
+ typedef typename S1::SS1 TYPE;
+ TYPE t;
+ Foo(t);
+}
+
+int main ()
+{
+ S1 obj;
+ Foo(obj);
+}
+
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 154)
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+template
+class S2
+{
+public:
+ static void f();
+};
+
+
+template
+class S1
+{
+ template
+ friend class S2;
+
+ static int i;
+};
+
+
+template
+void S2::f()
+{
+ S1::i = 3;
+}
+
+void g()
+{
+ S2::f();
+ S2::f();
+}
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: ttp53.C
===================================================================
--- ttp53.C (nonexistent)
+++ ttp53.C (revision 154)
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+
+// Submitted by Erez Louidor Lior
+
+template class H;
+template
+H foo(const H&);
+
+template
+class H{
+
+#ifdef OK
+public:
+#endif
+ template class Caster, typename Source>
+ static H cast(const H& s);
+
+#ifndef OK
+ template
+ friend H foo(const H&);
+#endif
+
+};
+
+template class caster;
+
+template
+H foo(const H& s){
+ return H::template cast(s);
+}
+
+int main(){
+ H i;
+ foo(i);
+}
ttp53.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp85.C
===================================================================
--- memtemp85.C (nonexistent)
+++ memtemp85.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+
+struct Q {
+ template
+ class X {
+ };
+};
+template class>
+class Y {
+};
+Y y1;
+
memtemp85.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: switch1.C
===================================================================
--- switch1.C (nonexistent)
+++ switch1.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+void f ()
+{
+ int i;
+
+ switch (int i = 3) {
+ }
+}
+
+template void f();
+
+
switch1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp68.C
===================================================================
--- memtemp68.C (nonexistent)
+++ memtemp68.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+ struct locale
+ {
+ template
+ locale (const locale&, _Facet*);
+ locale(int*) throw();
+ };
+ void f(int* p) { locale keep (p); }
memtemp68.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,35 @@
+// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
+// in their dejagnu baseboard description) require that the status is
+// final when exit is entered (or main returns), and not "overruled" by a
+// destructor calling _exit. It's not really worth it to handle that.
+// { dg-do run { xfail mmix-knuth-mmixware xtensa-*-elf* arm*-*-elf arm*-*-eabi m68k-*-elf } }
+
+// Bug: g++ was failing to destroy C::a because it was using two
+// different sentry variables for construction and destruction.
+
+extern "C" void _exit (int);
+
+int r = 1;
+
+struct A
+{
+ void f(){};
+ A(){ ++r; }
+ ~A(){ r -= 2; _exit (r); }
+};
+
+template
+struct C
+{
+ C(){ a.f(); }
+ static A a;
+};
+
+template A C::a;
+typedef C B;
+
+int main()
+{
+ C c;
+ return r;
+}
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: explicit82.C
===================================================================
--- explicit82.C (nonexistent)
+++ explicit82.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Sep 2000
+
+// Bug 508. We failed to set/clear lastiddecl appropriately for
+// operator names.
+
+struct A {};
+
+template void foo (A, int);
+template void operator<< (A, int);
+
+int main()
+{
+ A a;
+ operator<< (a, 0);
+ foo (a, 0);
+}
explicit82.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename28.C
===================================================================
--- typename28.C (nonexistent)
+++ typename28.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+//
+// Origin: Jens.Maurer@gmx.net
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Apr 2001
+
+// Bug 1844. We can meet types in cp_tree_equal via a template-id-expr.
+
+typedef int *Ptr;
+
+template struct B
+{
+ typedef typename T::template X type;
+ typedef typename T::template X type2;
+ typedef typename T::template X type3;
+
+ void foo (type);
+ void baz (type2);
+
+};
+
+template void B::foo (type)
+{
+}
+template void B::baz (type3)
+{
+}
typename28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit65.C
===================================================================
--- explicit65.C (nonexistent)
+++ explicit65.C (revision 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template void f ()
+{
+ abort ();
+}
+
+template <> void f ()
+{
+ abort ();
+}
+
+template void f (int)
+{
+ abort ();
+}
+
+template <> void f (int)
+{
+}
+
+template class C
+{
+ friend void f (int);
+ public:
+ void ff () { f (0); }
+};
+
+int main ()
+{
+ C c;
+ c.ff();
+}
explicit65.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,21 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+struct S
+{
+ template
+ int f(U u);
+};
+
+template <>
+template <>
+int S::f(int i) { return 1; }
+
+int main()
+{
+ S sc;
+
+ if (sc.f(3) != 1)
+ abort();
+}
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: ref2.C
===================================================================
--- ref2.C (nonexistent)
+++ ref2.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+class C;
+
+template
+class C {};
+
+int i;
+
+C c;
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: deduct7.C
===================================================================
--- deduct7.C (nonexistent)
+++ deduct7.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do run }
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jason Merrill 14 Jun 2001
+
+// Test that deduction can add cv-quals to a pointer-to-member type.
+
+struct A;
+int A::* pi;
+
+template void f (const T A::*) {}
+
+int main ()
+{
+ f (pi);
+}
deduct7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: label1.C
===================================================================
--- label1.C (nonexistent)
+++ label1.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+template
+struct S {};
+
+template
+inline void g(T t)
+{
+ here:
+ S st;
+ goto here;
+}
+
+template
+void f(T t)
+{
+ here:
+ g(t);
+ goto here;
+}
+
+void h()
+{
+ f(3);
+}
label1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+// Adapted from testcase by Corey Kosak
+
+template
+struct moo_t {
+ struct cow_t {};
+};
+
+template void foo(typename moo_t::cow_t) {}
+
+template void foo(moo_t) {
+ typename moo_t::cow_t p;
+ foo(p); // { dg-bogus "" "" { xfail *-*-* } } - no matching function for call -
+}
+
+int main() {
+ moo_t x;
+ foo(x); // { dg-bogus "" "" { xfail *-*-* } } - instantiated from here -
+}
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: memtemp10.C
===================================================================
--- memtemp10.C (nonexistent)
+++ memtemp10.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template
+ operator T*();
+};
+
+
+template
+S::operator T*()
+{
+ printf("Hello, world.\n");
+ return 0;
+}
+
+
+int main()
+{
+ S s;
+
+ char* cp = s.operator char*();
+}
memtemp10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t30.C
===================================================================
--- t30.C (nonexistent)
+++ t30.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template X f (auto X (*x)[n]) { return (*x)[n/2]; }
+extern int i[30], i2[33];
+extern double d[99];
+
+int foo (int ii) { return f (&i) + f(&i2); } // causes abort
+double foo (double dd) { return f (&d); }
t30.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-fpermissive -w" }
+// Origin: Mark Mitchell
+
+char foo[26];
+
+template
+void f ()
+{
+ foo = "0123456789012345678901234"; // { dg-error "array" }
+}
+
+template void f();
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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Origin: Theodore Papadopoulo
+
+template
+class A {
+public:
+ class B { };
+ class C: public B {
+ public:
+ C(A&):B() { }
+ };
+ C f() { return C(*this); }
+};
+
+int
+main()
+{
+ A a;
+ a.f();
+}
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: t13.C
===================================================================
--- t13.C (nonexistent)
+++ t13.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+template class B {
+public:
+ B();
+ A a;
+ int i;
+};
+
+void *f () {
+ return new B;
+}
+
+struct foo { int i[10]; };
+extern B *foop;
+
+void f2 () {
+ foop = new B;
+}
t13.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template
+class foo;
+
+template
+class bar
+{
+ typedef foo<(U::id > 0)> foobar;
+};
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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t, U u);
+
+template
+void foo(double, U) {}
+
+void baz()
+{
+ foo(3.0, "abc");
+ foo("abc", 3.0);
+}
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: t14a.C
===================================================================
--- t14a.C (nonexistent)
+++ t14a.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+class OBJECT
+{
+ int a;
+};
+
+
+
+template class TESTA
+{
+public:
+ TESTA();
+ T foo(int i) {T t = 0; return t;}
+};
+
+
+
+void foo()
+{
+ TESTA
t14a.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S
+{
+ template
+ void f ();
+
+};
+
+template
+template
+void S::f ()
+{
+ U& u; // { dg-error "" } uninitialized reference
+}
+
+template void S::f();
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 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+void f (T t) {
+ const_cast(t);
+}
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: memclass16.C
===================================================================
--- memclass16.C (nonexistent)
+++ memclass16.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+template
+class A {
+public:
+
+ typedef enum { X, Y } B;
+ template class Traits{ };
+};
+
+
+template class A;
+template class A::Traits::X>;
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: m2.C
===================================================================
--- m2.C (nonexistent)
+++ m2.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct A { A() { a = 2; } int a; };
+
+int f1 () {
+ struct A { A() { a = 2; } int a; };
+ A aa;
+ return aa.a;
+}
m2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template struct A;
+
+struct B
+{
+ template
+ friend class A; // { dg-error "" } does not specialize any args
+};
+
+struct C
+{
+ template
+ friend class A; // { dg-error "" } partial specialization
+};
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: ttp62.C
===================================================================
--- ttp62.C (nonexistent)
+++ ttp62.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do run }
+// Origin: Ewgenij Gawrilow
+
+extern "C" void abort ();
+
+template class B, class A>
+struct is_instance_of {
+ enum { answer=false };
+};
+
+template class B, class T>
+struct is_instance_of > {
+ enum { answer=true };
+};
+
+template struct C { };
+template struct D { };
+
+template
+bool is_C (const T&) {
+ return is_instance_of::answer;
+}
+
+int main() {
+ if (!is_C(C()))
+ abort ();
+ if (is_C(D()))
+ abort ();
+ return 0;
+}
ttp62.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp45.C
===================================================================
--- ttp45.C (nonexistent)
+++ ttp45.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+template struct temp2;
+template class M, class T> struct temp2, T> {};
+
+template struct temp1;
+template class M, class T> struct temp1 > {};
ttp45.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp28.C
===================================================================
--- ttp28.C (nonexistent)
+++ ttp28.C (revision 154)
@@ -0,0 +1,40 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ int f() { return d.f(); }
+};
+
+template class D,class E> int f(D &d1)
+{
+ d1.f();
+ C d2;
+ d2.f();
+ return 0;
+}
+
+template<> int f<>(D &d1)
+{
+ d1.f();
+ return 0;
+}
+
+int main()
+{
+ D c1;
+ D c2;
+ f(c1);
+ f(c2);
+}
ttp28.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S
+{
+ void g ()
+ {
+ }
+
+ friend void f (double)
+ {
+ }
+};
+
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: memtemp94.C
===================================================================
--- memtemp94.C (nonexistent)
+++ memtemp94.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Origin: Theodore Papadopoulo
+
+struct H {
+ template void k() const { }
+ typedef void (H::*pmf)() const;
+
+ pmf f() const { return &H::k; }
+};
memtemp94.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp77.C
===================================================================
--- memtemp77.C (nonexistent)
+++ memtemp77.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+extern "C" int strcmp(const char*, const char*);
+
+template
+struct S3
+{
+ template
+ static const char* h(U);
+};
+
+template <>
+template <>
+const char* S3::h(int) { return __PRETTY_FUNCTION__; }
+
+template <>
+template <>
+const char* S3::h(int) { return __PRETTY_FUNCTION__; }
+
+int main()
+{
+ if (strcmp (S3::h(7),
+ "static const char* S3::h(U) [with U = int, T = double]") == 0)
+ return 0;
+ else
+ return 1;
+}
memtemp77.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template
+struct S : public S {};
+template <>
+struct S {};
+
+void g()
+{
+ int S::*p;
+ int S::*q = p;
+}
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: memtemp5.C
===================================================================
--- memtemp5.C (nonexistent)
+++ memtemp5.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template
+ void operator+(T);
+};
+
+
+template
+void S::operator+(T)
+{
+ printf("Hello, world.\n");
+}
+
+
+
+int main()
+{
+ S s;
+ s + 3;
+ s + s;
+ s.operator+("Hi");
+}
memtemp5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit74.C
===================================================================
--- explicit74.C (nonexistent)
+++ explicit74.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do run }
+// Reduced from a testcase by Yotam Medini
+
+// egcs 1.1 seems to generate code that deletes a NULL pointer.
+
+template struct foo { void fuz(); ~foo(); };
+struct baz { int i; foo j; } *p = 0;
+template void foo::fuz() { delete p; }
+template foo::~foo() { delete p; }
+template class foo;
+int main() { foo(); }
explicit74.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// According to the non-normative example in
+// [temp.class.spec.mfunc]/2, these should be valid, but the grammar
+// in the Standard does not allow partial nor full specializations as
+// member-declarations, so we'd better not support them.
+
+template
+struct S {
+ template void f(U);
+ template <> void f(int); // { dg-error "" } invalid specialization
+
+ template struct I {}; // { dg-error "template" }
+ template struct I {}; // { dg-error "template" }
+ template <> struct I; // { dg-error "" } invalid specialization
+};
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: explicit57.C
===================================================================
--- explicit57.C (nonexistent)
+++ explicit57.C (revision 154)
@@ -0,0 +1,43 @@
+// { dg-do run }
+extern "C" void abort ();
+
+int a = 0;
+
+template void f ();
+template void g ()
+{
+ if (a)
+ abort ();
+}
+
+template <> void g ()
+{
+}
+
+template class C
+{
+ public:
+ void ff () { f (); }
+ void gg () { g (); }
+};
+
+template void f ()
+{
+ if (a)
+ abort ();
+}
+
+template <> void f ()
+{
+}
+
+int main ()
+{
+ C c;
+ c.ff();
+ c.gg();
+ a = 1;
+ C d;
+ d.ff();
+ d.gg();
+}
explicit57.C
Property changes :
Added: svn:eol-style
## -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.C
===================================================================
--- array1.C (nonexistent)
+++ array1.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do run }
+template
+ unsigned size(T (&)[N]) { return N; }
+template
+ unsigned size(T const (&)[N]) { return N; }
+
+int main() {
+ short iarray[] = { 1, 2, 3, 4, 5 };
+ const short carray[] = { 1, 2, 3, 4, 5 };
+ return size(iarray) - size(carray);
+}
array1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: test4.C
===================================================================
--- test4.C (nonexistent)
+++ test4.C (revision 154)
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+
+class B { };
+template class X : public B { int y[b]; };
test4.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Nov 2000
+
+// We ICE'd rather than fail to instantiate.
+
+template< typename SID, class SDR >
+void k( SID sid, SDR* p,
+ void (SDR::*)
+ ( typename SID::T ) );
+
+struct E { };
+struct S { void f( int ); };
+
+void f()
+{
+ k( E(), (S*)0, &S::f ); // { dg-error "" } no match
+}
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: t22.C
===================================================================
--- t22.C (nonexistent)
+++ t22.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+class AA { public: static int xx; };
+template class A {
+ public:
+ static int x;
+};
+
+int AA::xx;
+template int A::x; // { dg-bogus "" }
t22.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S {
+ struct X {};
+ struct Y {};
+
+ template
+ friend struct S::X;
+
+ template
+ friend typename S::Y; // { dg-error "" } typename as friend
+};
+
+struct T {
+ template
+ friend struct S::X;
+};
+
+struct U {
+ template
+ friend typename S::X; // { dg-error "" } typename as friend
+};
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: virtual1.C
===================================================================
--- virtual1.C (nonexistent)
+++ virtual1.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do run }
+ struct V { virtual ~V() {} };
+ template struct A : virtual V { };
+ template struct B {
+ virtual void f() { T foo; }
+ };
+ int main() { B< A > bar; }
virtual1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t05.C
===================================================================
--- t05.C (nonexistent)
+++ t05.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template class B { // { dg-error "" } candidates
+ A a;
+ public:
+ B(A&aa); // { dg-error "" } near match
+ ~B();
+};
+static B b_int (3); // { dg-error "" } no matching function
t05.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Theodore Papadopoulo
+
+double f(double);
+typedef double (*M)(double);
+
+class A {
+public:
+ template void g();
+};
+
+class B: public A {
+public:
+ void g() { A::g(); }
+};
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: typename6.C
===================================================================
--- typename6.C (nonexistent)
+++ typename6.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+template
+struct A
+{
+ typedef T A_Type;
+};
+
+
+template
+struct B : public A
+{
+ A_Type Func(); // { dg-error "" } declaration
+};
+
+template
+A::A_Type B::Func() // { dg-error "" } function
+{
+}
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: union2.C
===================================================================
--- union2.C (nonexistent)
+++ union2.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Origin: David Mazieres
+
+template struct vector_base {
+ typedef T elm_t;
+protected:
+ union {
+ double alignment_hack;
+ char defbuf_space[2 * sizeof (elm_t)];
+ };
+ elm_t *def_basep () { return reinterpret_cast (defbuf_space); }
+};
+
+template struct vector : public vector_base {
+ vector () { this->def_basep (); }
+};
+
+vector iv;
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: tiemann2.C
===================================================================
--- tiemann2.C (nonexistent)
+++ tiemann2.C (revision 154)
@@ -0,0 +1,35 @@
+// { dg-do run }
+extern "C" int printf (const char *, ...);
+template T max (const T&x, const T&y)
+{
+ return (x>y)?x:y;
+}
+
+class complex
+{
+ double re, im;
+ public:
+ complex (double r, double i=0) { re = r; im = i; }
+ friend int operator > (const complex& x, const complex &y);
+ void print () { printf ("re = %g; im = %g;\n", re, im); }
+};
+int operator >(const complex& x, const complex &y)
+{
+ double c1 = x.re * x.re + x.im * x.im;
+ double c2 = y.re * y.re + y.im * y.im;
+ return c1 > c2;
+}
+
+int main ()
+{
+ complex c1 (1, 0);
+ complex c2 (2, 0);
+ complex c3 (2, 3);
+ complex c4 (2, 1);
+
+ complex m1 = max (c1, c2);
+ complex m2 = max (c3, c4);
+ m1.print ();
+ m2.print ();
+ return 0;
+}
tiemann2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+// This testcase won't fail if class ::foo is forward-declared in the
+// global namespace, nor if class bar is not a template class.
+
+template
+class bar {
+public:
+ friend class foo; // this is not bar::foo, it forward-declares ::foo
+ class foo {};
+ bar() { foo(); } // but this should refer to bar::foo
+};
+
+bar<> baz;
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 154)
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+template
+class S2
+{
+public:
+ static void f();
+};
+
+class S1
+{
+ template
+ friend class S2;
+
+ static int i;
+};
+
+template
+void S2::f()
+{
+ S1::i = 3;
+}
+
+void g()
+{
+ S2::f();
+ S2::f();
+}
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: ttp54.C
===================================================================
--- ttp54.C (nonexistent)
+++ ttp54.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+// Reported by Bruce Eckel
+
+// [temp.deduct.type]
+// Make sure we treat in the construct TT as any type containing T.
+
+template class C
+{
+};
+
+template class TT> void f (TT &t)
+{
+}
+
+int main ()
+{
+ C c;
+ f(c);
+}
ttp54.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp86.C
===================================================================
--- memtemp86.C (nonexistent)
+++ memtemp86.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+
+struct Q {
+ template
+ class X {
+ };
+};
+template class>
+class Y {
+};
+Y y; // { dg-error "" } typename out of template context
+
memtemp86.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp69.C
===================================================================
--- memtemp69.C (nonexistent)
+++ memtemp69.C (revision 154)
@@ -0,0 +1,36 @@
+// { dg-do run }
+struct S
+{
+ template
+ void f(T (&i)[7])
+ {}
+
+ void g()
+ {
+ int i[] = {1, 2, 3, 4, 5, 6, 7};
+ f(i);
+ int j[7];
+ f(j);
+ }
+};
+
+struct foo {
+ template
+ static T* array_end(T(&array)[N]) { return &array[N]; }
+};
+
+struct X
+{
+ template
+ void f(const T1&) {}
+};
+
+int main(int ac, char* av[]) {
+ S s;
+ s.g();
+ int i[] = {1,2,3,4,5};
+ int* e = foo::array_end(i);
+ X x;
+ x.f("hello");
+}
+
memtemp69.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+struct S {
+ template
+ int f(T), g(T); // { dg-error "" } more than one declarator
+};
+
+template
+void x(T), y(T); // { dg-error "" } more than one declarator
+
+template
+struct S2
+{
+ static int i, j; // OK.
+};
+
+template
+int S2::i, S2::j; // { dg-error "" } more than one declarator
+
+template <>
+int S2::i, S2::i; // { dg-error "" } more than one declarator
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: spec12.C
===================================================================
--- spec12.C (nonexistent)
+++ spec12.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+struct S
+{
+ template
+ int f(U u);
+};
+
+
+template <>
+template <>
+int S::f(int i) { return 1; }
+
+int main()
+{
+ S sc;
+
+ if (sc.f(3) != 1)
+ abort();
+}
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: explicit66.C
===================================================================
--- explicit66.C (nonexistent)
+++ explicit66.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do run }
+void f(int) {}
+void f(double);
+
+template
+void foo() {}
+
+int main()
+{
+ foo();
+}
+
explicit66.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Origin: John Wilkinson
+
+template
+struct Base {
+ Base() : obj(Size) {}
+ T obj;
+};
+
+int globalInt = 5;
+
+struct A {
+ A(int arg) : ia(arg) {}
+ int ia;
+};
+
+int main()
+{
+ Base ob;
+ if (ob.obj.ia != 5)
+ return 1;
+}
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: parms1.C
===================================================================
--- parms1.C (nonexistent)
+++ parms1.C (revision 154)
@@ -0,0 +1,32 @@
+// { dg-do run }
+// Testcase for use of template parms as types for other template parms.
+
+template
+class A {
+ T a;
+public:
+ A(): a(t) {}
+
+ operator T () { return a; }
+};
+
+template
+class B {
+ A a;
+public:
+ B(A& b): a(b) {}
+
+ operator S () { return a*20; }
+};
+
+int
+main()
+{
+ A a;
+ B b(a);
+
+ if (b * a == 500)
+ return 0;
+ else
+ return 1;
+}
parms1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+// Simplified from bug report by Tim Rowley
+
+struct baz;
+
+void operator*(baz&, double);
+
+template inline T operator*(double s, const T &p)
+ ; // { dg-bogus "" "" } - must have argument of class type -
+
+void m(baz& a) { a * .5; }
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: memtemp11.C
===================================================================
--- memtemp11.C (nonexistent)
+++ memtemp11.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S
+{
+ template
+ S(U u, int i) {}
+
+ template
+ T foo(T t)
+ {
+ printf("Hello, world.\n");
+ return t;
+ }
+};
+
+
+int main()
+{
+ S s(3, 4);
+ int i = s.foo(3);
+ s.foo("hello");
+ s.foo(s);
+
+ S s2("hello", 5);
+}
memtemp11.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+template struct B { static const int i = 3; };
+template struct A { static const int i = B::i; };
+enum { i = A::i };
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: t31.C
===================================================================
--- t31.C (nonexistent)
+++ t31.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+struct B { int foo (); };
+int B::foo() { return 37; }
+
+template struct X {
+ void f();
+};
+
+template void X::f ()
+{}
+
+X x;
+
+void xyzzy () {
+ x.f ();
+}
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: explicit67.C
===================================================================
--- explicit67.C (nonexistent)
+++ explicit67.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+struct S
+{
+ void f(int);
+ void f(double);
+};
+
+void g(int);
+void g(double);
+
+template
+void foo();
+template
+void foo();
+
+void bar()
+{
+ foo(); // { dg-error "" } no matching function
+ foo(); // { dg-error "" } no matching function
+
+}
explicit67.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Apr 2001
+
+// Bug 2664. We failed to convert_from_reference for non-type
+// template parms.
+
+struct cow { };
+
+cow c;
+
+void func (cow &c) {}
+void operator-(cow &c) {}
+
+template void test()
+{
+ func(C); //OK
+ -C; //bogus error
+}
+
+int main()
+{
+ test ();
+}
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: parms2.C
===================================================================
--- parms2.C (nonexistent)
+++ parms2.C (revision 154)
@@ -0,0 +1,39 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sept 2000
+
+// bug 73. We failed to compare explicit arguments for a TEMPLATE_ID_EXPR in a
+// TYPENAME_TYPE.
+
+struct Plus {
+ template
+ struct Sig { typedef int Third;};
+};
+
+
+template
+struct Ethel {
+ typedef int WrappedType;
+};
+
+struct Fred {
+
+ template
+ Ethel::Third> baz ();
+
+
+ template
+ Ethel::Third>
+ foo ( const Z&, const Ethel&, const Ethel&) const;
+};
+
+int main() {
+ Fred f;
+ Ethel e;
+ Plus p;
+
+ f.foo (p, e, e);
+
+ return 0;
+}
parms2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+template
+int f(T)
+{
+ return 1;
+}
+
+
+template
+int f(T*)
+{
+ return 0;
+}
+
+
+int main()
+{
+ int (*h)(int*) = &f;
+ int (&k)(int*) = f;
+
+ return (*h)(0) || (*k)(0);
+}
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 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+struct S
+{
+ S (int);
+ operator bool () const;
+};
+
+template
+void f ()
+{
+ if (const S &s = 3) {
+ }
+}
+
+template void f();
+
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 154)
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000
+
+// A pointer to member can only be formed by `&T::m', however, other forms
+// are ok for pointer to static member. Thus the error can only be determined
+// after overload resolution. In template deduction, this can disambiguate
+// otherwise ambiguous cases.
+
+struct A
+{
+ static int f (int);
+ int f (short);
+ void baz ();
+};
+
+template void foo (int (*)(T)); // { dg-error "" } candidate
+template void foo (int (A::*)(T)); // { dg-error "" } candidate
+
+
+void A::baz ()
+{
+ foo (&A::f); // { dg-error "" } ambiguous
+ foo (A::f);
+ foo (&(A::f));
+ foo (f);
+ foo (&f);
+}
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: builtin.C
===================================================================
--- builtin.C (nonexistent)
+++ builtin.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Bug: Checking whether A depends on template parms, we crash because
+// __builtin_va_list lacks TYPE_LANG_SPECIFIC.
+
+
+void f (__builtin_va_list arg)
+{
+ enum { a } A;
+}
builtin.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,37 @@
+// { dg-do run }
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Feb 2001
+
+// Bug 1981. using declarations in namespace scope were not remembered.
+
+namespace A
+{
+ void swap () {}
+}
+
+template void f()
+{
+ using A::swap;
+}
+
+template void f ();
+
+int foo (int) { return 0;}
+
+namespace B
+{
+ int foo (int) { return 1;}
+
+ template int baz ()
+ {
+ using ::foo;
+
+ return foo (1);
+ }
+ template int baz ();
+}
+
+int main ()
+{
+ return B::baz ();
+}
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: memtemp12.C
===================================================================
--- memtemp12.C (nonexistent)
+++ memtemp12.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ template
+ void foo(U);
+};
+
+void f()
+{
+ S s;
+}
memtemp12.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+struct S
+{
+};
+
+S g ();
+
+template
+void f ()
+{
+ const S& s = g ();
+}
+
+template void f();
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: t32.C
===================================================================
--- t32.C (nonexistent)
+++ t32.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template struct A {
+ int fooo (int x);
+ int x;
+ inline int y () { return 3; }
+ inline int z () { return 5; }
+};
+
+template int A::fooo (int t) { return (this->*(x?&A::y : &A::z))() + t; } // { dg-bogus "" }
+
+A ai;
+
+int frop () { return ai.fooo (100); }
t32.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do link }
+// This test should get a linker error for the reference to A::i.
+// { dg-error "i" "" { target *-*-* } 0 }
+
+template struct B { static const int i = 3; };
+template struct A { static const int i = B::i; };
+const int *p = &A::i;
+
+int main ()
+{
+ // Examine p to prevent optimising linkers from discarding it.
+ return (p != 0);
+}
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: stmtexpr2.C
===================================================================
--- stmtexpr2.C (nonexistent)
+++ stmtexpr2.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do run }
+extern "C" void abort();
+
+int i;
+
+void g()
+{
+ i++;
+}
+
+template
+void f(T)
+{
+ __extension__ ({g();});
+}
+
+int main()
+{
+ f(3.0);
+ if (i != 1)
+ abort();
+
+ return 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 154)
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+// Origin: Andreas Kloeckner
+
+template struct iterator_traits {
+ typedef typename Iterator::iterator_category
+ iterator_category; // { dg-error "" } no type iterator_category
+};
+
+template
+struct iterator {
+ typedef Category iterator_category;
+};
+
+
+template
+struct reverse_iterator : public
+iterator::iterator_category> { // { dg-error "" } no type iterator_category
+ protected:
+ Iterator current;
+
+};
+class tag { };
+
+template
+struct list {
+ template
+ struct list_iterator {
+ };
+
+ reverse_iterator > rbegin()
+ { return reverse_iterator >
+ (list_iterator(Head->next())); } // { dg-error "" } not declared
+};
+
+template class list;
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: crash19.C
===================================================================
--- crash19.C (nonexistent)
+++ crash19.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+template
+void f()
+{
+ class C { public: int c; };
+
+ struct S {
+ void g() {
+ C e;
+ e.c = 3;
+ };
+ };
+
+ S s;
+ s.g();
+}
+
+template void f<7>();
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: instantiate5.cc
===================================================================
--- instantiate5.cc (nonexistent)
+++ instantiate5.cc (revision 154)
@@ -0,0 +1,5 @@
+// this file is part of testcase instantiate5.C
+
+template void foo() { }
+inline int bar() { foo(); return 1; }
+static int i = bar();
Index: error3.C
===================================================================
--- error3.C (nonexistent)
+++ error3.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001
+
+// Bug 1606. We sorry'd issuing an error.
+
+struct A {};
+template class Tpl {};
+
+struct B {
+ Tpl s;
+};
+
+void foo (B *ptr)
+{
+ ptr->Tpl.t (); // { dg-error "" } template as expression
+}
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 154)
@@ -0,0 +1,27 @@
+// { dg-do link }
+
+template
+int f(int (*fn)(T))
+{
+ return (*fn)(3);
+}
+
+struct S {
+ static int g(int) { return 1; }
+ static void g();
+
+ int h();
+};
+
+int S::h()
+{
+ return f(&g);
+}
+
+
+int main()
+{
+ S s;
+ if (s.h () != 1)
+ return 1;
+}
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: spec3.C
===================================================================
--- spec3.C (nonexistent)
+++ spec3.C (revision 154)
@@ -0,0 +1,38 @@
+// { dg-do run }
+extern "C" void abort();
+
+class X
+{
+ public:
+ virtual int f() const = 0;
+};
+
+template
+class Y: public X
+{
+ public:
+ virtual int f() const;
+};
+
+template
+int Y::f() const
+{
+ abort();
+ return 0;
+}
+
+template <>
+int Y::f() const;
+
+template <>
+int Y::f() const
+{
+ return 0;
+}
+
+int main()
+{
+ Y yb;
+
+ yb.f();
+}
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: memclass18.C
===================================================================
--- memclass18.C (nonexistent)
+++ memclass18.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template struct A {
+ template struct B;
+};
+
+template template struct A::B { };
+
+A::B b;
memclass18.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,44 @@
+// { dg-do compile }
+// Test that template friends referring to class template members are
+// respected.
+
+
+template struct A
+{
+ int f (T);
+ struct AI {
+ int f (T);
+ };
+};
+
+class B
+{
+ template friend int A::f (T);
+ template friend struct A::AI;
+ int a;
+public:
+ B(): a(0) { }
+};
+
+template int A::f (T)
+{
+ B b;
+ return b.a;
+}
+
+template int A::AI::f (T)
+{
+ B b;
+ return b.a;
+}
+
+int main ()
+{
+ A a;
+ A::AI ai;
+
+ int r = a.f (0);
+ r |= ai.f (0);
+
+ return r;
+}
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: friend27.C
===================================================================
--- friend27.C (nonexistent)
+++ friend27.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+class S
+{
+ friend void f<>(int); // { dg-error "" } does not match any template
+ int i;
+};
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: m4.C
===================================================================
--- m4.C (nonexistent)
+++ m4.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+struct A1 { struct B { B(); } b; };
+struct A2 { struct B { ~B(); } b; };
+char xx[] ="../tests/m4.cc:1: warning: return type specification for constructor invalid";
+
+
m4.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,21 @@
+// { dg-do run }
+// Although template class B is not used at all, it causes the
+// incorrect specialization of A to be selected
+
+// Adapted from testcase by Oskar Enoksson
+
+extern "C" void abort();
+
+template // Base class
+class A { public: static int n() { return sizeof(T); } };
+
+template // Derived #1
+class B: public A {};
+
+template // Derived #2 (wrong!)
+class C: public A {};
+
+int main() {
+ if (C<1,2>::n() != 2)
+ abort();
+}
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: ttp64.C
===================================================================
--- ttp64.C (nonexistent)
+++ ttp64.C (revision 154)
@@ -0,0 +1,58 @@
+// { dg-do assemble }
+
+// Origin: David Margery
+
+// Bug: We fail to set DECL_TEMPLATE_PARM_P when reducing template
+// parameter level.
+
+template class A2 {
+public:
+ A2() {}
+ virtual ~A2() {}
+ template A2 & operator=(const A2 o) {
+ i=o.i;
+ return *this;
+ }
+ T i;
+ T j;
+};
+
+template class A1 {
+public:
+ A1() {}
+ virtual ~A1() {}
+ template A1 & operator=(const A1 o) {
+ i=o.i;
+ return *this;
+ }
+ template A1 & operator=(const A2 o) {
+ i=o.i;
+ return *this;
+ }
+ T i;
+};
+
+template class T> class B {
+public:
+ B(){}
+ virtual ~B(){}
+ template class O> struct rebind { typedef B other ;};
+ template class O> B & operator=(const B o) {
+ i=o.i;
+ return *this;
+ }
+ T i;
+};
+
+int main(int argc, char *argv[]) {
+
+ A1 a1;
+ A1 a2;
+ a1=a2;
+
+ B b1;
+ B b2;
+ b1=b2;
+
+ return 0;
+}
ttp64.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp47.C
===================================================================
--- ttp47.C (nonexistent)
+++ ttp47.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+template class TT, class T> void f(T)
+{
+}
+
+template class TT, class T> void f(T)
+{
+}
+
+template class C {};
+template class D {};
+
+int main()
+{
+ f(1);
+ f(1);
+}
ttp47.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp96.C
===================================================================
--- memtemp96.C (nonexistent)
+++ memtemp96.C (revision 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+// Test for partial specialization of a member function template.
+// Origin: Jason Merrill
+
+template struct A {
+ template int f(U) { return 42; }
+};
+
+template <>
+template
+int A::f(U);
+
+template <>
+template
+int A::f(U) { return 24; }
+
+int main ()
+{
+ A ai;
+ if (ai.f(0) != 42)
+ return 1;
+
+ A ad;
+ if (ad.f(0) != 24)
+ return 1;
+
+ A ac;
+ if (ac.f(0) != 36)
+ return 1;
+}
+
+template <>
+template
+int A::f(U) { return 36; }
memtemp96.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp79.C
===================================================================
--- memtemp79.C (nonexistent)
+++ memtemp79.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+struct foo {
+ template static void bar( foo* );
+ template void bar() const; // { dg-bogus "" } quals
+};
memtemp79.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Neil Booth, from bug report #44
+
+#include
+
+template
+struct X
+{
+};
+
+template
+X operator+(const X&, const X&);
+
+template<>
+X operator+(const X&, const X&);
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: enum3.C
===================================================================
--- enum3.C (nonexistent)
+++ enum3.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do run }
+struct S { enum en { s0, s1, s2 }; };
+
+template
+int val( )
+{
+ return e;
+}
+
+
+int main()
+{
+ return val( );
+}
+
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: ttp2.C
===================================================================
--- ttp2.C (nonexistent)
+++ ttp2.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template class D
+{
+};
+
+template class D,int> class C
+{
+};
+
+int main()
+{
+ C<1,D> c; // { dg-error "" } args not match
+}
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: ptrmem5.C
===================================================================
--- ptrmem5.C (nonexistent)
+++ ptrmem5.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+// Based on testcase by adriang@campbellsoft.com
+
+struct Null {
+ template operator T*() { return 0; }
+ template operator T C::*() { return 0; }
+#if WORK_AROUND
+ typedef int pmf();
+ template operator pmf C::* () { return 0; }
+#endif
+} NULL;
+
+int *pd = NULL;
+int (*pf)() = NULL;
+int Null::*pmd = NULL;
+int (Null::*pmf)() = NULL;
warn2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp7.C
===================================================================
--- memtemp7.C (nonexistent)
+++ memtemp7.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template
+ S(T, U, T);
+};
+
+
+template
+S::S(T t1, U u1, T t2)
+{
+ printf("Hello, world.\n");
+}
+
+
+int main()
+{
+ S s1(3, "abc", 3);
+ S s2('a', s1, 'a');
+}
memtemp7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit76.C
===================================================================
--- explicit76.C (nonexistent)
+++ explicit76.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+// Based on bug report by Simon A. Crase
+
+
+struct foo {
+ template void bar();
+};
+
+template void foo::bar(); // { dg-bogus "" "" { xfail *-*-* } } - ICE -
explicit76.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ template
+ void f();
+};
+
+
+template
+template <> // { dg-error "enclosing class templates|invalid explicit specialization" }
+void S::f () // { dg-error "does not match|invalid function declaration" }
+{
+}
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: explicit59.C
===================================================================
--- explicit59.C (nonexistent)
+++ explicit59.C (revision 154)
@@ -0,0 +1,42 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template void f ();
+template void g ()
+{
+ abort ();
+}
+
+template <> void g ()
+{
+ abort ();
+}
+
+template class C
+{
+ public:
+ void ff () { f (); }
+ void gg () { g (); }
+ template void f () {}
+ template void g () {}
+};
+
+template void f ()
+{
+ abort ();
+}
+
+template <> void f ()
+{
+ abort ();
+}
+
+int main ()
+{
+ C c;
+ c.ff();
+ c.gg();
+ C d;
+ d.ff();
+ d.gg();
+}
explicit59.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// Origin: Brendan Kehoe
+
+ template int foo(char[4][x]) { return x; }
+ int (*bar)(char[4][3]) = &foo;
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: crash62.C
===================================================================
--- crash62.C (nonexistent)
+++ crash62.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jan 2001
+
+// Bug 911, ICE on bogus template declaration
+
+template class A; // { dg-error "" } not a template
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: poi1.C
===================================================================
--- poi1.C (nonexistent)
+++ poi1.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Gerald Pfeifer
+
+template
+class TLITERAL : public T
+ {
+ int x;
+ };
+
+class GATOM;
+
+typedef TLITERAL x;
+extern TLITERAL y;
+
+
poi1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t41.C
===================================================================
--- t41.C (nonexistent)
+++ t41.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+struct A {
+ struct B {
+ B (int);
+ };
+ static int foop (B);
+ int splat () {
+ return foop (B (1));
+ }
+};
t41.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template void f()
+{
+ extern void g ();
+}
+
+int main()
+{
+ f();
+}
+
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: virtual3.C
===================================================================
--- virtual3.C (nonexistent)
+++ virtual3.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+struct S
+{
+ int i;
+};
+
+template
+struct X : virtual public T, virtual public S
+{
+ int i;
+
+ X () : i (3) {}
+};
virtual3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t24.C
===================================================================
--- t24.C (nonexistent)
+++ t24.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+template int f (X x, X y) { return 23; }
+
+int foo () {
+ return f (7); // { dg-error "" }
+}
t24.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+template
+class TEST
+{
+public:
+ TEST (A) {}
+};
+
+template
+class TEST2
+{
+ static A i;
+};
+
+template
+A TEST2 ::i (0);
+
+TEST2 > a;
+
+template class TEST2 >;
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: t07.C
===================================================================
--- t07.C (nonexistent)
+++ t07.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template class B {
+ A a;
+ public:
+ const A& value () { return a; }
+};
+static B b_int;
+
+int foo () { return b_int.value(); }
t07.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+template
+inline unsigned int asize(ARRY &a)
+{
+ return sizeof(a) / sizeof(a[0]);
+}
+
+void f(unsigned int n) {
+ int x[n];
+
+ asize(x); // { dg-error "" } no matching function
+}
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: typename8.C
===================================================================
--- typename8.C (nonexistent)
+++ typename8.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+template < class T > class A
+{
+public:
+ typedef typename T::myT anotherT; // { dg-error "" } undefined type
+
+ anotherT t; // { dg-error "" } undefined type
+
+ A() { }
+ A(anotherT _t) { // { dg-error "" } undefined type
+ t=_t;
+ }
+
+ anotherT getT() { // { dg-error "" } undefined type
+ return t;
+ }
+};
+
+class B : public A< B > // { dg-error "" } forward declaration
+{
+public:
+ typedef int myT;
+};
+
+int main() {
+ B b;
+}
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: friend36.C
===================================================================
--- friend36.C (nonexistent)
+++ friend36.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template
+void f(T) {} // { dg-error "previously" }
+
+template
+struct S {
+ template
+ friend void f(T) {} // { dg-error "redefinition" }
+};
+
+S si;
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: niklas01.C
===================================================================
--- niklas01.C (nonexistent)
+++ niklas01.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template struct A {};
+template struct B : A > {};
+
+B x;
niklas01.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp56.C
===================================================================
--- ttp56.C (nonexistent)
+++ ttp56.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+
+template
+class A {
+};
+template
+class B {
+};
+
+template class AA> // { dg-bogus "" } `template template class A' previously declared here
+class C {
+ class D {
+ };
+ D d;
+ class E : public B {
+ };
+ E e;
+};
+
+int main() {
+ C c; // { dg-bogus "" } redefinition of `template template class A'
+}
+
ttp56.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp88.C
===================================================================
--- memtemp88.C (nonexistent)
+++ memtemp88.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+
+struct Q {
+ template
+ class X {
+ };
+ template class XX = X> // { dg-bogus "" } (original definition appeared here)
+ class Y {
+ }; // { dg-bogus "" } redefinition of default argument for `template XX'
+ Y<> y;
+};
+
memtemp88.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template struct A;
+template struct A { };
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: koenig1.C
===================================================================
--- koenig1.C (nonexistent)
+++ koenig1.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Aug 2000
+
+// bug 123. We ICEd when koenig lookup found a COMPONENT_REF inside a
+// TEMPLATE_ID_EXPR.
+
+void foo(void (*f)());
+
+struct A {
+template
+static void g();
+template
+void f(); // { dg-error "" } candiate
+
+static void f_plus ()
+ {
+ foo (f<0>); // { dg-error "" } no match
+ foo (g<0>);
+ }
+};
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: spec31.C
===================================================================
--- spec31.C (nonexistent)
+++ spec31.C (revision 154)
@@ -0,0 +1,3 @@
+// { dg-do assemble }
+template <> struct A {}; // { dg-error "" } not a specialization
+template <> void f (); // { dg-error "" } not a 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: explicit68.C
===================================================================
--- explicit68.C (nonexistent)
+++ explicit68.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ static void g();
+};
+
+template
+void g();
+
+template
+void f()
+{
+ const bool b = true;
+ g();
+ const bool b1 = (Length == 2);
+ S::g();
+}
+
+void h()
+{
+ f<3>();
+}
explicit68.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+class X
+{
+public:
+ template
+ X() {}
+
+ template
+ X::X() {} // { dg-error "" } non-template type used as a template
+};
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: parms3.C
===================================================================
--- parms3.C (nonexistent)
+++ parms3.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Test that we can represent static_casts in template arg lists.
+
+template struct A { };
+
+template struct B {
+ A(3.14)> a;
+};
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: memtemp30.C
===================================================================
--- memtemp30.C (nonexistent)
+++ memtemp30.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ template
+ void g(U u) { this; }
+};
+
+
+int main()
+{
+ S s;
+ s.g(3);
+}
memtemp30.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 May 2001
+
+// Bug 2184. Using decls in templates weren't doing the right thing.
+
+namespace N {
+ template
+ class vector {};
+}
+
+void g(const int&) {
+ using N::vector;
+ typedef vector V;
+}
+
+template
+void f(const J&) {
+ using N::vector;
+ typedef vector V;
+}
+
+int main() {
+ f(0);
+}
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: memtemp13.C
===================================================================
--- memtemp13.C (nonexistent)
+++ memtemp13.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ template
+ void foo(U);
+};
+
+void f()
+{
+ S s;
+ s.foo(3);
+ s.foo("hello");
+}
memtemp13.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: var1.C
===================================================================
--- var1.C (nonexistent)
+++ var1.C (revision 154)
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template T t; // { dg-error "" } template declaration of t
var1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+int g (T);
+
+int j = g (3);
+
+template
+inline T f (T)
+{
+ return 2;
+}
+
+template
+struct S
+{
+ static const int i;
+};
+
+template
+const int S::i = f (3);
+
+template
+int g (T)
+{
+ return S::i;
+}
+
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 154)
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// Origin: Jens Maurer
+
+template
+class C { };
+
+template
+C call(T& obj)
+{ return C();
+}
+
+class Test {
+public:
+ void output(int);
+};
+
+void sub()
+{
+ Test t;
+ call(t);
+}
+
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: t16.C
===================================================================
--- t16.C (nonexistent)
+++ t16.C (revision 154)
@@ -0,0 +1,31 @@
+// { dg-do run }
+extern "C" int printf (const char *, ...);
+template T max (const T&x, const T&y)
+{
+ return (x>y)?x:y;
+}
+int min (const float&, const float&);
+int min (const int& i1, const int& i2) {
+ return (i1 < i2) ? i1 : i2;
+}
+
+class complex
+{
+ double re, im;
+ public:
+ complex (double r, double i=0) { re = r; im = i; }
+ friend int operator > (const complex& x, const complex &y) { return 0; }
+ void print () { }
+};
+
+int main ()
+{
+ complex c1 (1, 0);
+ complex c2 (2, 0);
+
+ int j = max (1, 37);
+ complex m1 = max (c1, c2);
+ m1.print ();
+ printf ("j=%d\n", j);
+ return 0;
+}
t16.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+template
+struct S {};
+
+template <>
+struct S
+{
+ void f();
+ void g();
+};
+
+void S::f() {}
+
+template <>
+void S::g() {} // { dg-error "" } does not match any template 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: overload12.C
===================================================================
--- overload12.C (nonexistent)
+++ overload12.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Testcase for not trying a candidate that would generate an ill-formed
+// instantiation.
+
+template struct A {
+ int ar[N];
+};
+
+template struct B {
+ B () { };
+ B (const A &) { };
+ B (const A &, int);
+};
+
+int
+main ()
+{
+ A<1> a;
+ B<1> b1;
+ B<1> b2 (a);
+}
+
overload12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass19.C
===================================================================
--- memclass19.C (nonexistent)
+++ memclass19.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template struct A {
+ template struct B;
+};
+
+template template struct A::B { };
+
+A::B b;
memclass19.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000
+
+// bug 42. We ICE'd on instantiating a template with a bogus templated friend.
+
+template struct X
+{
+ template friend X; // { dg-error "" } friend must use aggr tag
+};
+
+X g;
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 154)
@@ -0,0 +1,39 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 May 1999
+
+// Template deduction and type unification should not issue diagnostics when
+// they're trying to see if it's possible. Here deduction fails in some cases
+// because you cant cv qualify a function type.
+
+template void fn(){} // A
+
+template void fn(T const *){} // B
+
+// these next two specializations need to know if they're specializing A or B.
+// They specialize A, because they can't instantiate B.
+
+template<> void fn() {} // ok, specialize A
+
+template<> void fn() {} // ok, specialize A
+
+// now make sure we moan when we really should
+template void foo(T const *){}
+
+void f()
+{
+ foo(); // { dg-error "" } attempt to build int & const *
+ foo(); // { dg-error "" } attempt to build void (const *)()
+}
+
+typedef void (*Fptr)();
+
+template void PV(Fptr const &, T const * const &);
+template void PV(T1 const * const &, T2 const * const &);
+
+void baz()
+{
+ void *t;
+ PV(&baz, t);
+}
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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+class mystream;
+
+template class a;
+
+template mystream& operator>>( mystream& s, a& thea );
+
+template class a {
+public:
+ friend mystream& operator>> <>( mystream&, a& thea );
+private:
+ T amember;
+};
+
+template<> mystream& operator>> ( mystream& s, a& thea );
+
+template class a;
+
+template<> mystream& operator>> ( mystream& s, a& thea )
+{
+ thea.amember = 0;
+ return s;
+}
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: m5.C
===================================================================
--- m5.C (nonexistent)
+++ m5.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+struct B { struct A { A(); int a; } aa; };
+struct A { A(); int a; };
+B::A::A () { a = 37; }
+char xx[]="../tests/m5.cc:3: Segmentation violation";
m5.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+// Adapted from testcase by Oskar Enoksson
+
+extern "C" void abort();
+
+template
+class A {
+public:
+ typedef T0 T;
+};
+
+template
+class B {
+ typedef A BC;
+};
+
+template
+class C {
+public:
+ typedef A AC;
+};
+
+int main() {
+ if (sizeof(C<3,7>::AC::T) != 7)
+ abort();
+}
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: explicit10.C
===================================================================
--- explicit10.C (nonexistent)
+++ explicit10.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+template
+void foo(T t);
+
+int main()
+{
+ foo(3.0);
+}
explicit10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp65.C
===================================================================
--- ttp65.C (nonexistent)
+++ ttp65.C (revision 154)
@@ -0,0 +1,38 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij
+
+// Bug: We used reject template unification of two bound template template
+// parameters.
+
+template class C
+{
+};
+
+template void f(C c)
+{
+}
+
+template void f(C c)
+{
+}
+
+template class C, class T, class U>
+void g(C c)
+{
+}
+
+template class C, class T> void g(C c)
+{
+}
+
+int main()
+{
+ C c1;
+ f(c1);
+ g(c1);
+ C c2;
+ f(c2);
+ g(c2);
+}
ttp65.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp48.C
===================================================================
--- ttp48.C (nonexistent)
+++ ttp48.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+template class TT, class T> void f(T)
+{
+}
+
+template class TT, class T> void f(T)
+{
+}
+
+template class C {};
+template class D {};
+
+int main()
+{
+ f(1);
+ f(1);
+}
ttp48.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp97.C
===================================================================
--- memtemp97.C (nonexistent)
+++ memtemp97.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+// Origin: Mark Mitchell
+
+template struct A {
+ template int f(U) { return 1; }
+};
+
+template <>
+template
+int A::f(U) { return 0; }
+
+A a;
+
+int main ()
+{
+ return a.f (3);
+}
memtemp97.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,65 @@
+// { dg-do assemble }
+// Origin: Neil Booth, from bug report #36
+
+template class vect;
+template vect operator-( const vect&, const vect& );
+
+template
+class vect
+{
+public:
+ vect( t a );
+
+ vect( const vect& v );
+ ~vect();
+
+ vect& operator=( const vect& v );
+ vect operator-( void ) const;
+ friend vect (::operator- <>)( const vect&, const vect& );
+
+private:
+ t a_;
+};
+
+template inline
+vect::vect( t a )
+: a_(a)
+{
+}
+
+template inline
+vect::vect( const vect& v )
+: a_(v.a_)
+{
+}
+
+template inline
+vect::~vect()
+{
+}
+
+template inline vect&
+vect::operator=( const vect& v )
+{
+ a_ = v.a_;
+ return *this;
+}
+
+template inline vect
+vect::operator-( void ) const
+{
+ return vect( -a_ );
+}
+
+template inline vect
+operator-( const vect& u, const vect& v )
+{
+ return vect( u.a_ - v.a_ );
+}
+
+int
+main( void )
+{
+ vect a( 1.0 ), b( 0.0 );
+ b = -a;
+}
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: ehspec1.C
===================================================================
--- ehspec1.C (nonexistent)
+++ ehspec1.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Bug: g++ forgets to instantiate A
+// Contributed by Jason Merrill
+
+template struct A { };
+void f () throw (A);
ehspec1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+template
+struct U
+{
+ T mT;
+};
+
+template
+struct M
+{
+ enum FLAG {On, Off};
+ U mUF;
+};
+
+M gm;
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: ttp3.C
===================================================================
--- ttp3.C (nonexistent)
+++ ttp3.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template class D
+{
+};
+
+template class D,class E> class C
+{
+};
+
+int main()
+{
+ C c; // { dg-error "" } param list not match/sees it as not having a type
+}
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: lookup1.C
===================================================================
--- lookup1.C (nonexistent)
+++ lookup1.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template
+ struct __vector_alloc_base
+{
+ typedef int allocator_type;
+};
+
+template
+ struct vector : __vector_alloc_base
+{
+ typedef short allocator_type;
+ explicit vector(const allocator_type& a = allocator_type()) {}
+};
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: memtemp8.C
===================================================================
--- memtemp8.C (nonexistent)
+++ memtemp8.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+struct S {
+ template
+ operator T();
+};
+
+
+template
+S::operator T()
+{
+}
+
memtemp8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec40.C
===================================================================
--- spec40.C (nonexistent)
+++ spec40.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Feb 2001
+
+// More from bug 1617. We didn't resolve partial ordering properly. The
+// std is rather vague about it anyway, DR 214 talks about this.
+
+template int Foo (T const *) {return 1;}
+template int Foo (char const (&)[I]) {return 2;}
+
+int main ()
+{
+ return Foo ("a") != 2;
+}
spec40.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit77.C
===================================================================
--- explicit77.C (nonexistent)
+++ explicit77.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+template
+struct S {};
+
+template
+struct S : public S, S {};
+
+template
+void f(S, S);
+
+void g() {
+ S<0, 0, 0> s0;
+ S<0, 1, 2> s2;
+
+ f<0>(s0, s2);
+ f(s0, s2); // { dg-error "" } no matching function
+}
explicit77.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+/* [temp.expl.spec] p18. */
+
+template
+struct A {
+ template class B { };
+};
+
+template
+class A::B { // { dg-error "" } only one template header
+};
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: array4.C
===================================================================
--- array4.C (nonexistent)
+++ array4.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Test to make sure that the array bounds are treated as an expression
+// in template parm substitution.
+
+// Written by Jason Merrill
+
+
+template void f (T t) { int ar[sizeof (T)]; }
+
+int
+main ()
+{
+ f (1);
+}
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: crash63.C
===================================================================
--- crash63.C (nonexistent)
+++ crash63.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001
+
+// Bug 1585. We ICEd on a template template parm with no parms.
+
+template class C> class B;
+template class C> class D; // { dg-error "" } parse error
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: t42.C
===================================================================
--- t42.C (nonexistent)
+++ t42.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+extern "C" void abort ();
+
+struct A {
+ struct stat {
+ int x;
+ stat (int j) { abort (); }
+ };
+ static int stat (double d) { return 0; } // { dg-bogus "" } cfront takes it
+ static int zap () {
+ stat (0);
+ return stat (1); // { dg-bogus "" } this should work
+ }
+};
+
+int main () {
+ return A::zap ();
+}
t42.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Origin: Leon Bottou
+
+class AA { protected:
+ template struct BB { T x; BB(const T &x) : x(x) { }; };
+ template struct CC : public BB { CC(const T &x) : BB(x) { };
+};
+};
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: virtual4.C
===================================================================
--- virtual4.C (nonexistent)
+++ virtual4.C (revision 154)
@@ -0,0 +1,41 @@
+// { dg-do run }
+// Origin: Mark Mitchell
+
+struct B
+{
+ B ();
+ virtual void f () = 0;
+};
+
+B::B ()
+{
+}
+
+extern B* bp;
+
+template
+struct C : public B
+{
+ virtual void f ()
+ {
+ }
+};
+
+template
+struct D : public B
+{
+ virtual void f ()
+ {
+ bp = new C;
+ }
+};
+
+B* bp = new D;
+
+int main ()
+{
+ bp->f ();
+ bp->f ();
+}
+
+
virtual4.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+// On targets that don't support weak symbols, we require an explicit
+// instantiation of arr.
+// { dg-require-weak "" }
+
+template
+struct A {
+ static T arr[5];
+};
+
+template
+T A::arr[5] = { 0, 1, 2, 3, 4 };
+
+int main ()
+{
+ return A::arr[0];
+}
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: t25.C
===================================================================
--- t25.C (nonexistent)
+++ t25.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template int f (X x, X y) { return 23; }
+template int f (X x, int j = 3) { return 29; }
+
+int foo () {
+ return f (7); // { dg-bogus "" }
+}
t25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t08.C
===================================================================
--- t08.C (nonexistent)
+++ t08.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template class B {
+ A a;
+ public:
+ B ();
+ ~B ();
+};
+B b_int;
+B *bp = &b_int;
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: export1.C
===================================================================
--- export1.C (nonexistent)
+++ export1.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Nov 2000
+
+
+// bug 721, we died horribly when export was used wrongly
+
+struct test {
+int export(void); // { dg-error "" } parse error
+};
+
+int test::export(void) // { dg-error "" } parse error
+{
+return 0;
+}
+
+template class Y;
+export template class X; // { dg-warning "" } export not implemented
export1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum.C
===================================================================
--- enum.C (nonexistent)
+++ enum.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// GROUPS passed enums
+template
+struct templ
+{
+ enum { val = 0 };
+};
+struct Foo
+{
+ enum {
+ bar = 0,
+ len = templ::val
+ };
+};
+void func()
+{
+ int s = Foo::bar; // Ensure that expansion of templ did not erase bar
+}
enum.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: enum10.C
===================================================================
--- enum10.C (nonexistent)
+++ enum10.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template
+struct S {
+ enum E { a = (int) T::b };
+};
+
+struct S2 {
+ enum E2 { b };
+};
+
+template class S;
enum10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp31.C
===================================================================
--- memtemp31.C (nonexistent)
+++ memtemp31.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S
+{
+ template
+ void g(U u)
+ { this; }
+};
+
+int main()
+{
+ S s;
+ s.g(3);
+}
memtemp31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp14.C
===================================================================
--- memtemp14.C (nonexistent)
+++ memtemp14.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf (const char *, ...);
+
+template
+struct S
+{
+ template
+ void foo(U, V);
+};
+
+
+template
+template
+void S::foo(U, V)
+{
+ printf("Hello, world.\n");
+}
+
+
+int main()
+{
+ S s;
+ s.foo(3, 3);
+ s.foo("hello", s);
+
+ S s2;
+ s2.foo(3, 3);
+ s2.foo("hello", s);
+}
memtemp14.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek
+
+template struct foo {
+ foo();
+ void c();
+ static void d(foo* x) { x->c(); }
+};
+template struct bar {
+ bar();
+};
+template struct baz {
+ typedef foo t;
+ t *e;
+ baz();
+ ~baz() { t::d(e); }
+};
+template void foo::c()
+{
+ bar* x = (bar*)this;
+ x->bar::~bar();
+}
+void a(void)
+{
+ baz b;
+}
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: t34.C
===================================================================
--- t34.C (nonexistent)
+++ t34.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template struct A { int operator [] (int); };
+template int A::operator[] (int j) { return j * j; }
+
+extern A avpp;
+
+int q () { return avpp[99]; }
t34.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S {
+ typedef typename T::Y::Z X; // { dg-error "" } No Y in A
+ X x; // { dg-error "" } No Y in A
+};
+
+struct A {
+ struct Y {
+ typedef A Z;
+ };
+};
+
+template struct S;
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: t34a.C
===================================================================
--- t34a.C (nonexistent)
+++ t34a.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+struct A {
+ int operator[] (int);
+};
+
+//int A::operator[] (int);
+
+int A::operator[] (int j)
+{
+ return j * j;
+}
+
+extern A a;
+
+int q () { return a[99]; }
t34a.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+template
+struct B
+{
+ B();
+ ~B();
+};
+template
+struct D
+{
+ D(int r0);
+ D(B &, int);
+};
+template
+void func()
+{
+ D tmp;
+}
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: spec5.C
===================================================================
--- spec5.C (nonexistent)
+++ spec5.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+template
+void f(T t1, T t2);
+
+template <>
+void f(int i, int j);
+
+template
+void g(T t1, T t2) {}
+
+template void g(int i, int j);
+
+void h()
+{
+ f(3, 'c'); // { dg-error "" } no matching function
+ g(3, 'c'); // { dg-error "" } no matching function
+}
+
+
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: overload13.C
===================================================================
--- overload13.C (nonexistent)
+++ overload13.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+struct A {
+ template int f (T) { return 0; }
+ int f (int) { return 1; }
+};
+
+int main ()
+{
+ A a;
+ return a.template f (0); // { dg-error "" }
+}
overload13.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Nov 2000
+
+// bug 43. Two failings, bison parser ickiness caused us to find the member
+// named the same as a friend, and then when instantiating, we'd lookup in
+// the wrong scope.
+
+namespace X {
+ template class P;
+
+ template void operator- (const P&);
+
+ template
+ struct V
+ {
+ V (const T&);
+
+ void operator- ();
+ friend void X::operator-<> (const P& a);
+ };
+}
+
+int main()
+{
+ X::V b(1.0);
+
+ return 0;
+}
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: unify7.C
===================================================================
--- unify7.C (nonexistent)
+++ unify7.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Feb 2000
+
+// template functions can be distinguished by return type alone. The return
+// type may also be a template parameter.
+
+template C foo (); // { dg-bogus "" }
+
+void g ()
+{
+ int (*pfn1) () = &foo; // { dg-bogus "" }
+ void (*pfn2) () = &foo; // { dg-bogus "" }
+}
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: friend29.C
===================================================================
--- friend29.C (nonexistent)
+++ friend29.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+template class a;
+
+template void foo( a& thea );
+
+template class a {
+public:
+ friend void foo<>( a& thea );
+private:
+ T amember;
+};
+
+template void foo( a& thea )
+{
+ thea.amember = 0;
+}
+
+template class 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: vaarg2.C
===================================================================
--- vaarg2.C (nonexistent)
+++ vaarg2.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation
+// Contributed by Nathan Sidwell 22 June 2000
+
+// Origin GNATS bug report 63 from Kurt Garloff
+// We attempted to expand va_arg prematurely in a template function.
+
+#include
+
+template
+void PrintArgs (Type somearg, ...)
+{
+va_list argp;
+va_start (argp, somearg);
+Type value;
+while ( ( value = va_arg (argp, Type) ) > 0.0)
+ continue;
+va_end (argp);
+}
+
+int main (void)
+{
+double dummy = 0;
+PrintArgs (dummy, 1.0, 2.0, 3.0, -1.0);
+return 0;
+}
vaarg2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: m6.C
===================================================================
--- m6.C (nonexistent)
+++ m6.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+struct B { struct A { A(); int a; } aa; };
+B::A::A () { a = 37; }
+const char* xx[] = {
+"../tests/m6.cc:1: warning: return type specification for constructor invalid",
+"../tests/m6.cc:2: semicolon missing after declaration of `A'",
+"../tests/m6.cc:2: warning: empty declaration",
+"../tests/m6.cc: In function int A ():",
+"../tests/m6.cc:2: `a' undeclared (first use this function)",
+"../tests/m6.cc:2: (Each undeclared identifier is reported only once",
+"../tests/m6.cc:2: for each function it appears in.)",
+"../tests/m6.cc:2: warning: control reaches end of non-void function" };
+
m6.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit11.C
===================================================================
--- explicit11.C (nonexistent)
+++ explicit11.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t);
+
+template
+struct S {};
+
+int main()
+{
+ S si;
+
+ foo >(si);
+}
explicit11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp49.C
===================================================================
--- ttp49.C (nonexistent)
+++ ttp49.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template class C {};
+template class TT> class D {};
+
+int main()
+{
+ D d; // { dg-error "" } args not match
+}
ttp49.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp98.C
===================================================================
--- memtemp98.C (nonexistent)
+++ memtemp98.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+//Purpose:
+// Test nested template as template template arg.
+//Result:
+// Before the patch, got:
+// `C' is not a template
+
+template class T>
+struct A
+{
+ T m_t;
+};
+
+struct B
+{
+ template
+ struct C
+ {
+ V m_v;
+ };
+};
+
+A z;
memtemp98.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate12.C
===================================================================
--- instantiate12.C (nonexistent)
+++ instantiate12.C (revision 154)
@@ -0,0 +1,61 @@
+// { dg-do run }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000
+
+// Bug 635. We failed to emit initializer code for out-of-class defined
+// static const members of template instantiations.
+
+static int inited = 0;
+
+static bool setFlag()
+{
+ inited++;
+ return true;
+}
+
+template struct X
+{
+ static const bool cflag;
+ static bool flag;
+ static const bool iflag = true;
+ static const bool jflag = true;
+};
+
+template const bool X::cflag (setFlag ());
+template bool X::flag (setFlag ());
+template const bool X::iflag;
+
+int main ()
+{
+ X a;
+ if (!a.flag)
+ return 1;
+ if (!a.cflag)
+ return 2;
+ if (!a.iflag)
+ return 3;
+ if (!a.jflag)
+ return 5;
+ if (!X::flag)
+ return 5;
+ if (!X::cflag)
+ return 6;
+ if (!X::iflag)
+ return 7;
+ if (!X::jflag)
+ return 8;
+ if (inited != 4)
+ return 9;
+ return 0;
+}
+
+// On platforms that do not have weak symbols, these static data
+// members must be explicitly instantiated. The iflag and jflag data
+// members should not have to be explicitly instantiated because their
+// const-ness should allow the compiler to elide references to the
+// actual variables.
+template const bool X::cflag;
+template const bool X::flag;
+template const bool X::cflag;
+template const bool X::flag;
instantiate12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: friend1.C
===================================================================
--- friend1.C (nonexistent)
+++ friend1.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do run }
+template
+void f(T);
+
+class C
+{
+ template
+ friend void f(T);
+
+ int i;
+};
+
+
+template
+void f(T)
+{
+ C c;
+ c.i = 3;
+}
+
+
+int main()
+{
+ f(7);
+}
friend1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+
+template <>
+enum E {e}; // { dg-error "" } template declaration of enum
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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template class D
+{
+};
+
+template class D,class E> class C
+{
+ D<1> d; // { dg-error "" } arg not match
+};
+
+int main()
+{
+ C c;
+}
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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+struct A {
+ int i;
+};
+
+template
+struct B { };
+
+int main()
+{
+ B<&A::i> b;
+}
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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-fpermissive" }
+
+class A
+{
+protected:
+ void f1() {};
+};
+
+template class B : private A {
+protected:
+ using A::f1;
+};
+
+template class D : private B
+{
+public:
+ void f2() { f1(); }; // { dg-warning "" }
+};
+
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: memtemp9.C
===================================================================
--- memtemp9.C (nonexistent)
+++ memtemp9.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template
+ operator T();
+};
+
+template
+S::operator T()
+{
+ printf("Hello, world.\n");
+ return T();
+}
+
+int main()
+{
+ S s;
+
+ int i = s.operator int();
+}
memtemp9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec41.C
===================================================================
--- spec41.C (nonexistent)
+++ spec41.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+// Origin:
+
+// Bug: Specialization of implicitly created function should be
+// rejected.
+
+template class blah{};
+blah::blah(){} // { dg-error "" } invalid specialization
+int main(){}
spec41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit78.C
===================================================================
--- explicit78.C (nonexistent)
+++ explicit78.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+template
+struct A {
+};
+
+template
+struct B {
+ operator A<3> ();
+ operator B<3, 7> ();
+};
+
+
+template
+void f(B);
+
+template
+void f(A)
+{
+}
+
+int main()
+{
+ // Deduction fails with the first `f'. Since `3' is explicitly
+ // specified, we don't try any deduction with the second `f'. So,
+ // we call the second `f'.
+ f<3>(B<2, 7>());
+}
explicit78.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+
+template class A;
+// template <>
+class A; // { dg-error "" "" { xfail *-*-* } } missing template header -
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: array5.C
===================================================================
--- array5.C (nonexistent)
+++ array5.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+void h(T&);
+
+template
+void g ()
+{
+ h ("abcdefghi");
+}
+
+template void g();
+
+template
+void h(T&)
+{
+ T t = {};
+}
+
+
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: memtemp40.C
===================================================================
--- memtemp40.C (nonexistent)
+++ memtemp40.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct R
+{
+ template
+ void g(U u) {}
+};
+
+template
+struct S
+{
+ template
+ void f(U u) { R r; r.g(u); }
+};
+
+void foo()
+{
+ S si;
+ si.f("abc");
+}
memtemp40.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp23.C
===================================================================
--- memtemp23.C (nonexistent)
+++ memtemp23.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ S()
+ { printf ("In S::S()\n"); f(3); }
+
+ S(char)
+ { printf ("In S::S(char)\n"); f(*this); }
+
+ template
+ void f(U u)
+ { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); }
+
+ int c[16];
+};
+
+int main()
+{
+ S s;
+}
memtemp23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tt2.C
===================================================================
--- tt2.C (nonexistent)
+++ tt2.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+
+int f1 () {
+ struct A {
+ A() : b (2) { }
+ int fred () { return b.hi_mom; }
+ struct B {
+ int hi_mom;
+ B (int a) { hi_mom = a; }
+ };
+ B b;
+ };
+ A aa;
+ return aa.fred();
+}
+
+int f2 () {
+ struct A {
+ ~A() { a = 3; }
+ int a;
+ int fred () { return a + 1; }
+ };
+
+ A ab;
+ ab.a = 12;
+ return ab.fred();
+}
tt2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001
+
+// Bug 1546. We ICE'd trying to unify an array of unknown bound,
+// checking to see if it was a variable sized array.
+
+template class allocator {};
+
+template
+struct _Alloc_traits
+{
+ static const bool _S_instanceless = false;
+};
+
+template
+struct _Alloc_traits<_Tp, allocator<_Tp1> >
+{
+ static const bool _S_instanceless = true;
+};
+
+typedef char state [];
+bool y = _Alloc_traits >::_S_instanceless;
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: t26.C
===================================================================
--- t26.C (nonexistent)
+++ t26.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template int f (X x, unsigned int j = 3) { return 29; }
+template int f (X x, X y) { return 23; }
+
+int foo () {
+ return f (7.0, 9.0);
+}
t26.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+template inline STRUCT *
+setback(MEMBER *bp, MEMBER STRUCT::*offset)
+{
+ if(!bp) return 0;
+ union { int i; MEMBER STRUCT::*of; } u;
+ u.of = offset;
+ return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
+}
+
+
+struct S
+{
+ int i;
+};
+
+int main()
+{
+ S s;
+
+ S* sp = setback (&s.i, &S::i);
+}
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: static4.C
===================================================================
--- static4.C (nonexistent)
+++ static4.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ static const T t = 3;
+};
+
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 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Rick Campbell
+
+template
+struct DataMember
+{
+ inline DataMember (Type Owner::* data_member);
+
+ Type Owner::* _data_member;
+};
+
+template
+inline
+DataMember::DataMember (Type Owner::* data_member)
+ : _data_member (data_member)
+{
+}
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: t09.C
===================================================================
--- t09.C (nonexistent)
+++ t09.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+struct bs_1 {
+ typedef int (*pfi) (void);
+};
+static bs_1::pfi fp;
t09.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+// Overly simplified from testcase by "B. K. Oxley"
+
+template struct foo {
+ typedef P parent_type;
+ friend parent_type; // { dg-error "" } template parameters cannot be friends
+ friend Q; // { dg-error "" } template parameters cannot be friends
+};
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: explicit20.C
===================================================================
--- explicit20.C (nonexistent)
+++ explicit20.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+T foo(T t);
+
+template <>
+int foo(char c); // { dg-error "" } does not match any template declaration
explicit20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp58.C
===================================================================
--- ttp58.C (nonexistent)
+++ ttp58.C (revision 154)
@@ -0,0 +1,48 @@
+// { dg-do assemble }
+// Origin: Alex Samuel
+
+namespace NS
+{
+
+template
+struct Base
+{
+};
+
+template
+struct Z
+{
+ const static int value_ = false;
+};
+
+struct Outer
+{
+ template
+ struct A :
+ public Base ::value_>
+ {
+ };
+};
+
+template
+void f(T)
+{
+}
+
+}
+
+
+template class U>
+struct B
+{
+};
+
+
+int
+main ()
+{
+ B ba;
+ f (ba); // Koenig lookup
+ return 0;
+}
+
ttp58.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: niklas03.C
===================================================================
--- niklas03.C (nonexistent)
+++ niklas03.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template struct X {
+ A operator[] (int);
+};
+
+template A X::operator[] (int i)
+{
+ return A(); // { dg-bogus "" }
+}
+
+X x;
niklas03.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mi1.C
===================================================================
--- mi1.C (nonexistent)
+++ mi1.C (revision 154)
@@ -0,0 +1,76 @@
+// { dg-do run }
+// Test that binfos aren't erroneously shared between instantiations.
+
+class PK_CryptoSystem
+{
+};
+class PK_Encryptor : public virtual PK_CryptoSystem
+{
+};
+class PK_FixedLengthCryptoSystem : public virtual PK_CryptoSystem
+{
+public:
+ virtual unsigned int CipherTextLength() const =0;
+};
+class PK_FixedLengthEncryptor : public virtual PK_Encryptor, public virtual PK_FixedLengthCryptoSystem
+{
+};
+class PK_SignatureSystem
+{
+public:
+ virtual ~PK_SignatureSystem() {};
+};
+class PK_Signer : public virtual PK_SignatureSystem
+{
+public:
+ virtual void Sign() = 0;
+};
+class PK_Verifier : public virtual PK_SignatureSystem
+{
+};
+class PK_Precomputation
+{
+};
+template class
+PK_WithPrecomputation : public T, public virtual PK_Precomputation
+{
+};
+typedef PK_WithPrecomputation PKWPFLE;
+typedef PK_WithPrecomputation PKWPS;
+template class
+ECPublicKey : public PKWPFLE
+{
+public:
+ unsigned int CipherTextLength() const { return 1; }
+ EC ec;
+};
+template
+class ECPrivateKey : public ECPublicKey, public PKWPS
+{
+ void Sign() {}
+ int d;
+};
+template
+class ECKEP : public ECPrivateKey
+{
+};
+class GF2NT : public PK_CryptoSystem
+{
+ int t1;
+};
+class EC2N : public PK_CryptoSystem
+{
+ GF2NT field;
+ int a;
+};
+template class ECKEP;
+template class ECKEP;
+
+int
+main ()
+{
+ ECKEP foo;
+
+ return 0;
+}
+
mi1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template
+ struct moneypunct
+{
+ moneypunct ();
+};
+
+template <>
+ moneypunct::moneypunct ();
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: copy1.C
===================================================================
--- copy1.C (nonexistent)
+++ copy1.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do run }
+int i = 0;
+
+template
+class F
+{
+public:
+ F() {}
+
+ template F(F)
+ {
+ i = 1;
+ }
+};
+
+
+F
+foo()
+{
+ F f1;
+ F f2(f1);
+ return f1;
+}
+
+int
+main()
+{
+ return i;
+}
+
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: spec33.C
===================================================================
--- spec33.C (nonexistent)
+++ spec33.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do link }
+// Origin: James McKelvey
+
+class A
+{
+ public:
+ template A(T x, bool y = false);
+};
+
+template A::A(T, bool)
+{
+}
+
+template <> A::A(char, bool)
+{
+}
+
+int main()
+{
+ int b;
+ char c;
+
+ A x(b);
+ A y(c);
+ A z(c, false);
+}
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: spec16.C
===================================================================
--- spec16.C (nonexistent)
+++ spec16.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+template
+struct A {
+ int foo(const K&);
+ int bar(const K&);
+};
+
+template
+int
+A::bar(const K& k)
+{
+ return(foo(k));
+}
+
+template<>
+int
+A::foo(const char*const& k)
+{
+ return((__SIZE_TYPE__)k);
+}
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: enum11.C
===================================================================
--- enum11.C (nonexistent)
+++ enum11.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template void f1()
+{
+ struct foo { enum T2 {
+ un, du, toi };
+ };
+}
+
+void f2() { f1(); }
enum11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp32.C
===================================================================
--- memtemp32.C (nonexistent)
+++ memtemp32.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S
+{
+ template
+ void g(U u)
+ { i = 3; }
+
+ int i;
+};
+
+int main()
+{
+ S s;
+ s.g(3);
+}
memtemp32.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp15.C
===================================================================
--- memtemp15.C (nonexistent)
+++ memtemp15.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ template
+ void foo(U) {}
+};
+
+
+void f()
+{
+ S s;
+ s.foo(3);
+ s.foo("hello");
+}
memtemp15.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t35.C
===================================================================
--- t35.C (nonexistent)
+++ t35.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// { dg-options "" }
+template struct A {
+ A ();
+ ~A();
+ int x, y, z;
+};
+
+template inline A::A () { x = y = 3; z = 99; }
+template inline A::~A() { y = 9999; }
+
+A ai;
t35.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Sep 2000
+
+// bug 127. We ICE'd when given a non-template TYPE_DECL as a template name.
+
+template
+class basic_string
+{
+public:
+ typedef charT* iterator;
+ explicit basic_string ();
+ ~basic_string ();
+};
+
+void foo () {
+ basic_string::iterator p; // { dg-error "" } not a template // ERROR - no type
+}
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: t18.C
===================================================================
--- t18.C (nonexistent)
+++ t18.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+extern void byebye ();
+template
+struct A
+{
+ T1 t1;
+ T2 t2;
+ A() { t1 = 0; t2 = 0; }
+ ~A() { byebye(); }
+};
+
+template
+int f (A a) {
+ return a.t1;
+}
+
+extern A aa;
+int foop () { return f(aa); }
t18.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Origin: Ian Nixon
+
+class Action {
+public:
+ virtual void action () = 0;
+};
+
+class Var {
+public:
+
+ template void Add() {
+ struct tmp : public Action {
+ void action () {}
+ };
+ tmp *tp = new tmp;
+ }
+
+};
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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+enum E { };
+
+template
+struct S1
+{
+};
+
+
+struct S2
+{
+ static E es[1];
+};
+
+
+struct S3
+{
+ typedef S1 S3_Type;
+};
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: overload14.C
===================================================================
--- overload14.C (nonexistent)
+++ overload14.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Jan 2001
+
+// Bug 1639. We failed to have builtin relop candidates with enumeral type.
+
+template void operator == (T1, T2);
+
+enum E {e1};
+void operator != (E, E);
+
+bool Foo (E e)
+{
+ return e == e1;
+}
+bool Baz (E e)
+{
+ return e != e1; // { dg-error "" } void not ignored.
+}
overload14.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+struct S1
+{
+ template
+ void f(T t1, T t2);
+};
+
+
+template <>
+void S1::f(int i1, int i2);
+
+template
+struct S2
+{
+ template
+ void f(T t1, T t2);
+};
+
+template <>
+template <>
+void S2::f(int i1, int i2);
+
+void h()
+{
+ S1 s1;
+ s1.f(3, 'c'); // { dg-error "" } no matching function
+
+ S2 s2;
+ s2.f(3, 'c'); // { dg-error "" } no matching function
+}
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: vbase1.C
===================================================================
--- vbase1.C (nonexistent)
+++ vbase1.C (revision 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+// Check that template classes handle inherited virtual bases
+// properly, initializing them before direct non-virtual bases.
+
+extern "C" void exit (int);
+
+int aflag;
+
+struct A
+{
+ A() { aflag = 1; }
+};
+
+struct B : virtual public A
+{
+ B() { }
+};
+
+struct C
+{
+ C() { if (!aflag) exit (1); }
+};
+
+template
+struct D : public C, public Parent
+{
+ D() { }
+};
+
+int
+main ()
+{
+ D c;
+}
vbase1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Jan 2001
+
+// Bug 1630. Template deduction at a call allowed conversions more lenient than
+// qualification conversions. That would lead to misleading diagnostics during
+// overload resolution.
+
+
+template void Foo (T const **);
+template void Bar (T const * const *);
+void Foo (int); // { dg-error "" } candidate
+void Foo (float); // { dg-error "" } candidate
+
+void baz (int **p1)
+{
+ Foo (p1); // { dg-error "" } no such function
+ Bar (p1); // OK
+}
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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jan 2001
+
+// Bug 1033. We ICE'd when trying to make a non template class a templated
+// friend.
+
+class A {};
+class B {
+ template friend class A; // { dg-error "" } not a template
+};
+
+
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: m7.C
===================================================================
--- m7.C (nonexistent)
+++ m7.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+struct B { struct A { A(); int a; }; A aa; };
+B::A::A () { a = 37; }
+const char *xx[]= {"/*",
+"../tests/m7.cc:1: warning: return type specification for constructor invalid",
+"../tests/m7.cc: In function struct A A ():",
+"../tests/m7.cc:2: `a' undeclared (first use this function)",
+"../tests/m7.cc:2: (Each undeclared identifier is reported only once",
+"../tests/m7.cc:2: for each function it appears in.)",
+"../tests/m7.cc:2: warning: control reaches end of non-void function",
+ "*/" };
+
m7.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vaarg3.C
===================================================================
--- vaarg3.C (nonexistent)
+++ vaarg3.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation
+// Contributed by Nathan Sidwell 22 June 2000
+
+#include
+
+struct A {
+ virtual ~A () {};
+};
+
+template
+void PrintArgs (Type somearg, ...)
+{
+va_list argp;
+va_start (argp, somearg);
+Type value;
+value = va_arg (argp, Type); // { dg-error "" } cannot pass non-POD
+va_end (argp);
+}
+
+int main (void)
+{
+A dummy;
+PrintArgs (dummy, dummy); // { dg-error "" } cannot pass non-POD
+return 0;
+}
vaarg3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit12.C
===================================================================
--- explicit12.C (nonexistent)
+++ explicit12.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do link }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+template
+struct S
+{
+ template
+ void foo(T t);
+};
+
+
+template <>
+template <>
+void S::foo(int) {}
+
+int main()
+{
+ S s;
+ s.foo(3.0);
+}
explicit12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp99.C
===================================================================
--- memtemp99.C (nonexistent)
+++ memtemp99.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: bitti@cs.tut.fi
+
+template
+class Vector
+{
+public:
+ template
+ class Vector::CommaInit { }; // { dg-error "" } invalid definition
+};
memtemp99.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: instantiate13.C
===================================================================
--- instantiate13.C (nonexistent)
+++ instantiate13.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Jan 2001
+
+// Bug 1551. We were accessing some uninitialized memory, causing us
+// to reject this.
+
+template
+struct base
+{
+base();
+base(unsigned);
+};
+
+template
+struct Y
+{
+Y(unsigned = 0);
+};
+
+template <>
+Y::Y(unsigned) { }
+
+base x;
instantiate13.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template
+struct vector {};
+
+template
+void fn(T)
+{
+ enum tern { H, L, X, U };
+
+ vector ternvec; // { dg-error "" } composed from a local type
+}
+
+template void fn(int);
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: lookup3.C
===================================================================
--- lookup3.C (nonexistent)
+++ lookup3.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+template
+class A {
+public:
+ void f() { }
+};
+
+class B : public A {
+public:
+ void f();
+};
+
+int main()
+{
+ B b;
+ B& b1 = b;
+ b1.A::f();
+}
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: ptrmem8.C
===================================================================
--- ptrmem8.C (nonexistent)
+++ ptrmem8.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S
+{
+ void f (const T&);
+ void f (T&);
+};
+
+class C
+{
+};
+
+typedef int (C::*cp)();
+
+template struct S;
+
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: ttp5.C
===================================================================
--- ttp5.C (nonexistent)
+++ ttp5.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template class D
+{
+};
+
+template class D,class E> class C
+{
+ D d; // { dg-error "" } arg not match
+};
+
+int main()
+{
+ C c;
+}
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: explicit79.C
===================================================================
--- explicit79.C (nonexistent)
+++ explicit79.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template
+void f(int (*)[I] = 0);
+
+template
+void f();
+
+void g()
+{
+ f<-1>();
+}
explicit79.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template
+struct S {
+};
+
+template
+struct S {
+};
+
+template
+void f ()
+{
+ S s;
+}
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: array6.C
===================================================================
--- array6.C (nonexistent)
+++ array6.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Alfred Minarik
+
+template
+struct basic_filebuf
+{
+ virtual void
+ underflow()
+ {
+ int __size = 5;
+ char __conv_buf[__size];
+ }
+};
+
+template class basic_filebuf;
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: memtemp41.C
===================================================================
--- memtemp41.C (nonexistent)
+++ memtemp41.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ static void foo() {}
+};
memtemp41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp24.C
===================================================================
--- memtemp24.C (nonexistent)
+++ memtemp24.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ S()
+ { printf ("In S::S()\n"); f(3); }
+
+ S(char)
+ { printf ("In S::S(char)\n"); f(*this); }
+
+ template
+ void f(U u)
+ { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); }
+
+ int c[16];
+};
+
+int main()
+{
+ S s;
+ S s2('a');
+}
memtemp24.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Jan 2001
+
+// Bug 1506. We ICE'd on a struct definition inside a template parms.
+// This is still not completely fixed, but now issues a diagnostic
+
+
+template struct S{}; // { dg-error "before" }
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: t35a.C
===================================================================
--- t35a.C (nonexistent)
+++ t35a.C (revision 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+
+template struct A { };
+template <> struct A { int foo (); };
+int A::foo () { return 37; }
t35a.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t27.C
===================================================================
--- t27.C (nonexistent)
+++ t27.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template int f (X x, int * j) { return 29; }
+template int f (X x, ...) { return 23; }
+
+int foo () {
+ return f (7.0, 9.0);
+}
t27.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ static const T t = 3; // { dg-error "" } initializing non-integral type
+};
+
+double d = S::t;
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: local2.C
===================================================================
--- local2.C (nonexistent)
+++ local2.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+void f(T)
+{
+ struct S {
+ int i;
+ } s;
+
+ s.i = 3;
+
+ if (s.i != 3)
+ abort();
+}
+
+
+int main()
+{
+ f(7);
+}
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: crash48.C
===================================================================
--- crash48.C (nonexistent)
+++ crash48.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Origin: Jean-Francois Panisset
+
+template
+void foo(T *data)
+{
+ ((char *)data)->~T();
+}
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: friend39.C
===================================================================
--- friend39.C (nonexistent)
+++ friend39.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+template
+struct S;
+
+template
+class C
+{
+ friend void S::f();
+
+ int i;
+};
+
+template
+struct S
+{
+ void f() {
+ C c;
+ c.i = 3;
+ }
+};
+
+template void S::f();
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: explicit21.C
===================================================================
--- explicit21.C (nonexistent)
+++ explicit21.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+T foo(T* t);
+
+template <>
+int foo(char c); // { dg-error "" } does not match declaration.
+
+template <>
+int bar(); // { dg-error "" } no template bar.
explicit21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp59.C
===================================================================
--- ttp59.C (nonexistent)
+++ ttp59.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Marcin Kowalczyk
+
+template class t1, typename t0> void single()
+{
+ single();
+}
+
+template class T1 {};
+int main()
+{
+ single();
+}
ttp59.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Ian Nixon
+
+struct A {};
+
+template class Tc {}; // { dg-error "" } no defarg
+
+int main ()
+{
+ Tc oops; // { dg-error "" } using template
+}
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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Test for use of template parms in constructor name.
+// Submitted by Jason Merrill
+
+template
+struct A {
+ A();
+};
+
+template
+A::A() // { dg-error "invalid use of constructor|qualified name" }
+{
+}
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: call1.C
===================================================================
--- call1.C (nonexistent)
+++ call1.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+struct IsCompressed { };
+struct Field {
+ bool IsCompressed() const { return true; }
+};
+
+template
+inline bool
+for_each(const Field& p, IsCompressed, C)
+{
+ return p.IsCompressed();
+}
+
+template bool for_each(const Field& p, IsCompressed, int);
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: instantiate5-main.cc
===================================================================
--- instantiate5-main.cc (nonexistent)
+++ instantiate5-main.cc (revision 154)
@@ -0,0 +1,3 @@
+// this file is part of testcase instantiate5.C
+
+int main() {}
Index: spec34.C
===================================================================
--- spec34.C (nonexistent)
+++ spec34.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Jan 2001
+
+// Bug 1632. In copying default args from a template to a specialization, we
+// lost the object's CV quals, leading to an utterly confusing error message.
+
+struct X;
+
+template struct Y
+{
+ X *f (int i = 0) const;
+};
+
+template <> X *Y<2>::f (int i) const
+{
+ return f (i);
+}
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: enum12.C
===================================================================
--- enum12.C (nonexistent)
+++ enum12.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+template
+struct S1 { };
+
+template
+struct S2 {
+ enum { x = 3 };
+
+ void f(S1&);
+};
+
+template
+void S2::f(S1&)
+{
+}
enum12.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp33.C
===================================================================
--- memtemp33.C (nonexistent)
+++ memtemp33.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ template
+ void g(U u)
+ { i; }
+
+ int i;
+};
+
+int main()
+{
+ S s;
+ s.g(3);
+}
memtemp33.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp16.C
===================================================================
--- memtemp16.C (nonexistent)
+++ memtemp16.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S {
+ template
+ void operator+(T);
+};
+
+template
+template
+void S::operator+(T)
+{
+ printf("Hello, world.\n");
+}
+
+
+int main()
+{
+ S s;
+ s + 3;
+ s + s;
+ s.operator+("Hi");
+
+ S > s2;
+ s2 + 3;
+ s2 + s;
+ s2.operator+("Hi");
+}
memtemp16.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t36.C
===================================================================
--- t36.C (nonexistent)
+++ t36.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+void * foo () {
+ typedef int * ip;
+ return new ip;
+}
t36.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Aug 2000
+
+// bug 382. We ICE'd rather than decay to an address.
+
+struct A {
+template static void f(T) {}
+};
+void (*h)(int) = A::f;
+void (*i)(int) = &A::f;
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: nontype3.C
===================================================================
--- nontype3.C (nonexistent)
+++ nontype3.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+enum E { e };
+
+template
+struct S1
+{
+ static const char* s;
+};
+
+template
+struct S2 {};
+
+template <>
+struct S2<1>
+{
+ static E es[1];
+};
+
+struct S3
+{
+ typedef S1::es> S3_Type;
+};
+
+E S2<1>::es[1] = {e};
+
+template <>
+const char* S1::es>::s = "abc";
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: overload15.C
===================================================================
--- overload15.C (nonexistent)
+++ overload15.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// Test resolution of templatized overloaded constructors.
+// The more specialized constructor, i.e., A (const B &b)
+// should be chosen per \S 14.5.5.2/2 [temp.func.order/2].
+
+template
+struct B {
+ int f;
+};
+
+struct A {
+ template
+ A (const B &b) {}
+
+ template
+ A (const T &b) {}
+};
+
+int
+main ()
+{
+ B<2,3> b;
+ A a (b);
+ return 0;
+}
overload15.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,20 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+void f(T t1, T t2);
+
+template <>
+void f(int i, int j)
+{
+ abort();
+}
+
+void f(short s, char c)
+{
+}
+
+int main()
+{
+ f(3, 'c');
+}
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: typename10.C
===================================================================
--- typename10.C (nonexistent)
+++ typename10.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+struct S {
+ typedef int I;
+};
+
+void f(typename S::I); // { dg-error "" } using typename outside of template
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 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+class C {
+ template
+ friend class ::C;
+};
+
+namespace N
+{
+template
+class D {
+ template
+ friend class N::D;
+};
+}
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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+typedef enum {} i;
+
+template
+class Bar {};
+
+void f (Bar<21>, int) {}
+void f (Bar<2>, i) {}
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: m8.C
===================================================================
--- m8.C (nonexistent)
+++ m8.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+
+class A {
+ int a;
+ public:
+ A (int aa = 3);
+};
+
+class B {
+ class A {
+ public:
+ A (int, int);
+ };
+ A aa;
+ public:
+ B (int);
+};
+
+extern void foo();
+B::B (int z) : aa (1, z) {
+ foo ();
+}
m8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit30.C
===================================================================
--- explicit30.C (nonexistent)
+++ explicit30.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T, T*);
+
+
+void bar()
+{
+ double d;
+ (*((void (*)(int, double*)) (void (*)(int, int*)) &foo))(3, &d);
+}
explicit30.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit13.C
===================================================================
--- explicit13.C (nonexistent)
+++ explicit13.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do link }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+
+template
+struct S
+{
+ template
+ void foo(T t);
+
+ template
+ void bar(T t) { this->template foo(3.74); }
+};
+
+template <>
+template <>
+void S::foo(int) { }
+
+int main()
+{
+ S s;
+ s.bar(3);
+}
explicit13.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do run }
+template struct A {
+ template struct B {
+ template void f (V) { }
+ void g () { }
+ };
+};
+
+int main ()
+{
+ A::B b;
+ b.f (42);
+ b.g ();
+}
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: friend3.C
===================================================================
--- friend3.C (nonexistent)
+++ friend3.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+template
+void f(T);
+
+class C
+{
+ friend void f<>(double);
+
+ int i; // { dg-error "" } private
+};
+
+
+template
+void f(T)
+{
+ C c;
+ c.i = 3; // { dg-error "" } f is a friend, this is f.
+}
+
+
+int main()
+{
+ f(7);
+}
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: enum7.C
===================================================================
--- enum7.C (nonexistent)
+++ enum7.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do run }
+template
+int f()
+{
+ enum E { a = I };
+
+ struct S {
+ int g() {
+ E e;
+ e = a;
+ return (int) e;
+ }
+ };
+
+ S s;
+
+ return s.g();
+}
+
+
+int main()
+{
+ if (f<7>() != 7)
+ return 1;
+ if (f<-3>() != -3)
+ return 1;
+ return 0;
+}
enum7.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+void h(int);
+
+template
+class i {};
+
+struct B
+{
+ int i;
+};
+
+template
+struct D : public B
+{
+ void f();
+ void g() { h(i); }
+};
+
+template
+void D::f()
+{
+ h(i);
+}
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: ptrmem9.C
===================================================================
--- ptrmem9.C (nonexistent)
+++ ptrmem9.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+struct A;
+template void f (void (A::* const)(T)) {}
+void (*p)(void (A::* const)(int)) = f;
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: ttp6.C
===================================================================
--- ttp6.C (nonexistent)
+++ ttp6.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do run }
+template class F
+{
+};
+
+template class D,class E> class C
+{
+ D<1> d;
+};
+
+int main()
+{
+ C c;
+}
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: spec26.C
===================================================================
--- spec26.C (nonexistent)
+++ spec26.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// From: lat@iki.fi (Lassi A. Tuura)
+// Test that a specialization without an initializer is not a definition,
+// as specified in [temp.expl.spec].
+
+
+struct X;
+template struct Y { static const X array[]; };
+template <> const X Y::array [];
+struct X { int i; };
+template <> const X Y::array [] = { 0, 1, 2, 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: array7.C
===================================================================
--- array7.C (nonexistent)
+++ array7.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S {
+ enum E { e = 5 };
+ static int i[e];
+};
+
+template
+int S::i[S::e];
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: ttp10.C
===================================================================
--- ttp10.C (nonexistent)
+++ ttp10.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d; // { dg-error "" } D is a template
+ public:
+ int f();
+};
+
+template class D,class E> int C::f()
+{
+ return d.f(); // { dg-error "" } d not properly declared
+}
+
+int main()
+{
+ C c;
+ c.f();
+}
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: memtemp42.C
===================================================================
--- memtemp42.C (nonexistent)
+++ memtemp42.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+template
+class Foo {
+
+public:
+ template
+ Foo operator=(const Foo& z)
+ {
+ return Foo();
+ }
+};
+
+int main()
+{
+ Foo x;
+ Foo y;
+ x = y;
+
+ return 0;
+}
+
memtemp42.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp25.C
===================================================================
--- memtemp25.C (nonexistent)
+++ memtemp25.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ template
+ void f(U u) { printf ("%d\n", sizeof (U)); }
+
+ int i[4];
+};
+
+
+int main()
+{
+ S s;
+ s.f(3);
+ s.f(s);
+}
memtemp25.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,40 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 May 2001
+
+// Bug 2525. We ICEd when a namespace scope template was erroneously
+// given as a base member init.
+
+namespace N1
+{
+ template
+ struct B
+ {
+ B (T);
+ };
+
+ template
+ struct D : B
+ {
+ D (T r)
+ : B (r) // { dg-error "" } no field named B
+ {}
+ };
+}
+
+template
+struct D1 : N1::B
+{
+ D1 (T r)
+ : N1::B (r)
+ {}
+};
+
+template
+struct D2 : N1::B
+{
+ D2 (T r)
+ : N1::B (r) // { dg-error "" } no field named N1::B
+ {}
+};
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: t28.C
===================================================================
--- t28.C (nonexistent)
+++ t28.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template class B;
+template int f (B b) { return 37; }
+template class B { public: Y y; B() { y = 1; } };
+
+int foo () {
+ B bd;
+ return f(bd);
+}
t28.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,37 @@
+// { dg-do assemble }
+// Origin: Loring Holden
+
+template
+class REFptr {
+ public:
+ virtual ~REFptr();
+ REFptr &operator = (const REFptr& p);
+};
+
+class STR { };
+class str_ptr : public REFptr { };
+
+template
+class ARRAY {
+ protected:
+ T *_array;
+ int _num;
+ int _max;
+ public:
+ virtual void realloc(int new_max) {
+ _max = new_max;
+ T *tmp = new T [_max];
+ if (tmp == 0) return;
+ for (int i=0; i<_num; i++) {
+ tmp[i] = _array[i];
+ }
+ delete [] _array;
+ _array = tmp;
+ }
+};
+
+int
+main()
+{
+ ARRAY tags;
+}
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: static6.C
===================================================================
--- static6.C (nonexistent)
+++ static6.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do link { xfail *-*-aout *-*-coff *-*-hpux* *-*-hms } }
+
+// Simplified from testcase by Erez Louidor Lior
+
+template struct A {
+ static const int l[1];
+};
+
+template
+const int A::l[1] = {1};
+
+int i = A::l[0];
+
+int main(){}
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: local3.C
===================================================================
--- local3.C (nonexistent)
+++ local3.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+void f(T)
+{
+ int j;
+
+ j = 6;
+
+ struct S {
+ int i;
+ };
+
+ S s;
+
+ s.i = j;
+
+ if (s.i != 6)
+ abort();
+}
+
+
+int main()
+{
+ f(7);
+}
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: alignof.C
===================================================================
--- alignof.C (nonexistent)
+++ alignof.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+extern "C" void abort();
+
+struct S
+{
+ char c;
+ double d;
+};
+
+
+template
+void foo(T)
+{
+ if (__alignof__(T) != __alignof__(S))
+ abort();
+}
+
+
+int main()
+{
+ foo(S());
+}
alignof.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: niklas01a.C
===================================================================
--- niklas01a.C (nonexistent)
+++ niklas01a.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+struct A { // { dg-error "" } forward declaration
+ friend struct B : A { // { dg-error "" }
+ int x;
+ }; // { dg-error "" } class definition cannot be a friend
+ int y;
+};
niklas01a.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit22.C
===================================================================
--- explicit22.C (nonexistent)
+++ explicit22.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+T foo(T t, U* u);
+
+template
+T foo(T t, T* u);
+
+template <>
+int foo(int, int*);
explicit22.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template struct A;
+template struct A;
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: call2.C
===================================================================
--- call2.C (nonexistent)
+++ call2.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+struct IsCompressed { };
+struct Field {
+};
+
+template
+inline bool
+for_each(const Field& p, IsCompressed, C)
+{
+ return p.IsCompressed(); // { dg-error "" } calling type like a method
+}
+
+template bool for_each(const Field& p, IsCompressed, int);
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 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+template class vec {
+ double x[n];
+
+ public:
+ vec() {
+ for (int i=0; i& v) {
+ for (int i=0; i& v, const double& y) {
+ for (int i=0; i vec& operator,(const vec& v, const double& y) {
+ return *(new vec(v, y));
+}
+
+
+int main() {
+ vec<4> v;
+ vec<5> w;
+ w=(v,3.);
+}
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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-O2 -Winline" }
+// Origin: Mark Mitchell
+
+template
+inline void f ()
+{
+
+}
+
+void g ()
+{
+ f ();
+}
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: eichin01a.C
===================================================================
--- eichin01a.C (nonexistent)
+++ eichin01a.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+template class TC {
+public:
+ X aaa;
+ static X sss;
+ TC(X a) {aaa = a; }
+ TC(X a, X s) {aaa = a; sss = s; }
+ void sz(X s) { sss = s; }
+};
+
+
+template <> long TC::sss = 0;
+template <> float TC::sss = 0.0;
+
+TC xjj(1,2);
+
+int main(int,char*) {
+ TC xff(9.9,3.14);
+ xjj.sz(123);
+ xff.sz(2.71828);
+ return 0;
+}
eichin01a.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Jan 2001
+
+// Bug 1617. We didn't resolve partial ordering properly. The std is rather
+// vague about it anyway, DR 214 talks about this.
+
+extern "C" int puts (char const *);
+
+template int Foo (T); // { dg-error "" } candidate
+template int Foo (T &); // { dg-error "" } candidate
+
+template int Qux (T); // { dg-error "" } candidate
+template int Qux (T const &); // { dg-error "" } candidate
+
+template int Bar (T const *const &); // { dg-error "" } candidate
+template int Bar (T *const &); // { dg-error "" } candidate
+template int Bar (T *); // { dg-error "" } candidate
+
+template int Baz (T *const &); // { dg-error "" } candidate
+template int Baz (T *); // { dg-error "" } candidate
+
+int Baz (int const *ptr, int *ptr2)
+{
+ Baz (ptr2); // { dg-error "" } ambiguous
+ Bar (ptr2); // { dg-error "" } ambiguous
+ Foo (ptr2); // { dg-error "" } ambiguous
+ Qux (ptr2); // { dg-error "" } ambiguous
+ return 0;
+}
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: spec18.C
===================================================================
--- spec18.C (nonexistent)
+++ spec18.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+
+template
+void foo(const A& a, const B& b)
+{
+}
+
+template
+void foo(const A& a, const int& b)
+{
+}
+
+template
+void foo(const A*& a, const B& b)
+{
+}
+
+template<>
+void foo(const int&, const double&)
+{
+}
+
+
+int
+main()
+{
+ foo("98239", 23);
+ foo(232, 1.022);
+}
+
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: partial1.C
===================================================================
--- partial1.C (nonexistent)
+++ partial1.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do run }
+template
+class foo {
+public:
+ enum bar { z = 0 };
+};
+
+template
+class foo {
+public:
+ enum bar { z = 1 };
+};
+
+template
+class foo {
+public:
+ enum bar { z = 2 };
+};
+
+int main()
+{
+ if ((foo::z == 0) && (foo::z == 1)
+ && (foo::z == 2))
+ return 0;
+ else
+ return 1;
+}
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: nontype4.C
===================================================================
--- nontype4.C (nonexistent)
+++ nontype4.C (revision 154)
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+template
+class s
+{
+public:
+ s (R &r) : _r (r) {}
+
+ void e (void) { (_r.*A) (); }
+
+private:
+ R &_r;
+};
+
+class x
+{
+public:
+ void test1 (void) { int j = 0; }
+ void test2 (void) { int j = 1; }
+};
+
+int
+main (void)
+{
+ x r;
+
+ s c4 (r);
+ s c5 (r);
+
+ return 0;
+}
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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+template class A {
+ public:
+ class subA {};
+};
+
+
+template class B : public A {
+ public:
+ class subB : public A::subA {}; // { dg-error "" } not a class or namespace
+};
+
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: typename11.C
===================================================================
--- typename11.C (nonexistent)
+++ typename11.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+template
+struct S {
+ struct X {};
+};
+
+template
+typename S::X f(T, U) {
+ typename S::X();
+ return typename S::X();
+}
+
+template S::X f(int, double);
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 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jun 2001
+
+// Bug 2929. We were forgetting about template parm scope when
+// injecting a friend decl into a class template specialization's
+// containing scope.
+
+template class Vec;
+
+template <> class Vec
+{
+public:
+ Vec ();
+ Vec & Fn (double);
+ friend Vec Fn (const Vec &, double);
+}; // pop_binding ICE
+
+template class Alloc
+{
+ template struct Rebind
+ {
+ typedef Alloc<_Tp1> other;
+ };
+};
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: mangle2.C
===================================================================
--- mangle2.C (nonexistent)
+++ mangle2.C (revision 154)
@@ -0,0 +1,40 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 April 2001
+// Origin:pcarlini@unitus.it
+
+// Bug 2559. We hadn't implemented code to mangle numbers bigger than
+// HOST_WIDE_INT.
+
+template
+class integer_traits_base
+{
+public:
+static const bool is_integral = true;
+};
+
+template
+class integer_traits
+{
+public:
+static const bool is_integral = false;
+};
+
+template<>
+class integer_traits
+: public integer_traits_base
+{ };
+
+integer_traits f;
+
+template T foo ()
+{
+ return value;
+}
+
+void x ()
+{
+ foo ();
+}
mangle2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: m9.C
===================================================================
--- m9.C (nonexistent)
+++ m9.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+struct A { A() { a = 1; } int a; };
+struct Q {
+ struct A { A() { a = 2; } int a; };
+ struct R {
+ struct A { A() { a = 3; } int a; };
+ A aaz;
+ };
+ R rrr;
+ A aay;
+}
+;
+
+Q qqq;
+A aav;
m9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit31.C
===================================================================
--- explicit31.C (nonexistent)
+++ explicit31.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do link }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+template
+struct S
+{
+ template
+ static double foo(U u) { return (double) u; }
+};
+
+
+int main()
+{
+ double d = S::foo(3.3);
+
+ return (d >= 3.1);
+}
explicit31.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,19 @@
+// { dg-do run }
+template struct A {
+ template struct B {
+ template void f (V) { }
+ void g () { }
+ };
+ template struct B {
+ void h () { }
+ };
+};
+
+int main ()
+{
+ A::B b;
+ b.f (42);
+ b.g ();
+ A::B b2;
+ b2.h ();
+}
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: explicit14.C
===================================================================
--- explicit14.C (nonexistent)
+++ explicit14.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+struct S
+{
+ template
+ typename U::R foo(U u);
+};
+
+
+void bar()
+{
+ S si;
+}
explicit14.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+class C
+{
+ template
+ friend void f(T);
+
+ int i;
+};
+
+
+template
+void f(T)
+{
+ C c;
+ c.i = 3;
+}
+
+
+int main()
+{
+ f(7);
+}
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: enum8.C
===================================================================
--- enum8.C (nonexistent)
+++ enum8.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+template
+void f();
+
+template <>
+void f<4>() {}
+
+template
+struct S
+{
+ enum E { a = 1, b = a + 3 };
+};
+
+int main()
+{
+ f::b>();
+}
enum8.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inject1.C
===================================================================
--- inject1.C (nonexistent)
+++ inject1.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S {
+ struct T* x;
+};
+
+template struct S<2>;
+
+T* t;
inject1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+struct B {
+ int i;
+};
+
+struct D: public B {
+ int i;
+};
+
+template
+struct D2 : public D {
+ void f() { i = 3; }
+};
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: ttp7.C
===================================================================
--- ttp7.C (nonexistent)
+++ ttp7.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template class D
+{
+};
+
+template class D,class E> class C // { dg-error "" } ref below
+{
+ D d; // { dg-error "" } arg not match
+};
+
+int main()
+{
+ C c;
+}
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: sizeof.C
===================================================================
--- sizeof.C (nonexistent)
+++ sizeof.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+int bar() { return I; }
+
+template
+int foo(T)
+{
+ return bar() + bar();
+}
+
+
+int main()
+{
+ if (foo(2) != sizeof(int) + 4 + sizeof(long) + 7)
+ abort();
+}
sizeof.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+template
+struct Y {};
+
+template
+struct X {};
+
+template
+void f()
+{
+ typename X >::A a;
+}
+
+template
+struct X >
+{
+};
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: bad-type.C
===================================================================
--- bad-type.C (nonexistent)
+++ bad-type.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+template
+class A
+{
+public:
+ Type m;
+};
+
+template
+void f(A& a, Type d)
+{
+ A.m=d; // { dg-error "" } invalid use of template
+}
+
+int main()
+{
+ A a;
+ f(a,2);
+}
+
bad-type.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ int f() { return d.f(); }
+};
+
+int main()
+{
+ C c;
+ C d;
+ c.f();
+ d.f();
+}
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: memtemp60.C
===================================================================
--- memtemp60.C (nonexistent)
+++ memtemp60.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// GROUPS passed membertemplates
+template
+struct S
+{
+ S(const S& x) {}
+
+ template
+ S(const S& x) {}
+};
memtemp60.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp43.C
===================================================================
--- memtemp43.C (nonexistent)
+++ memtemp43.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+template
+class A
+{
+public:
+ template
+ void operator=(A const & a) { return; }
+};
+
+int main()
+{
+ A a;
+ A b;
+ a = b;
+}
memtemp43.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp26.C
===================================================================
--- memtemp26.C (nonexistent)
+++ memtemp26.C (revision 154)
@@ -0,0 +1,28 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ template
+ void f(U u);
+
+ int i[4];
+};
+
+
+template
+template
+void S::f(U u)
+{
+ printf ("%d\n", sizeof (U));
+}
+
+
+int main()
+{
+ S s;
+ s.f(3);
+ s.f(s);
+}
memtemp26.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "" }
+//
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 May 2001
+
+// Bug 2526. We ICE'd after diagnosing dependent name confusion in
+// friendliness when not being pedantic.
+
+template
+struct B
+{
+ typedef B Mother;
+};
+
+template
+struct D : B
+{
+ friend class Mother;
+};
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: t29.C
===================================================================
--- t29.C (nonexistent)
+++ t29.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+template X f (auto X (*x)[n]) { return (*x)[n/2]; }
+extern int i[30];
+extern double d[99];
+
+int foo (int ii) { return f (&i); } // causes abort
+double foo (double dd) { return f (&d); }
t29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: link1.C
===================================================================
--- link1.C (nonexistent)
+++ link1.C (revision 154)
@@ -0,0 +1,29 @@
+// { dg-do link }
+// Origin: Mark Mitchell
+
+template
+int f(T);
+
+template
+struct S {
+ template
+ friend int f(U) { return 0; }
+};
+
+int k = f(2);
+
+template
+int g(T);
+
+int h = g(7);
+
+template
+int g(T) {
+ S si;
+ return 0;
+}
+
+int main()
+{
+}
+
link1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+struct S {
+ S() {}
+
+ static S s;
+};
+
+template
+S S::s;
+
+S si;
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 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+struct S {};
+
+S si;
+
+template
+int f(T t)
+{
+ struct S {
+ int g(int i) { return i + 2; }
+ };
+
+ S s;
+
+ return s.g(t) + s.g(t);
+}
+
+
+int main()
+{
+ if (f(3) != 10)
+ abort();
+}
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: typedef1.C
===================================================================
--- typedef1.C (nonexistent)
+++ typedef1.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Testcase for handling of typedef wierdness.
+
+template
+struct A
+{
+ typedef enum
+ {
+ foo
+ } B;
+
+ A (B b);
+};
+
+template
+A::A (B b)
+{
+}
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: typename20.C
===================================================================
--- typename20.C (nonexistent)
+++ typename20.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell
+
+template
+struct B {
+ typedef int I;
+};
+
+template
+struct S : public B {
+ struct I {
+ };
+
+ void f(int i = true) {}
+};
typename20.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: niklas01b.C
===================================================================
--- niklas01b.C (nonexistent)
+++ niklas01b.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template struct A { T *t; inline A() { t = 0; } };
+template struct B : A > { int x; inline B() { x = 3; } };
+
+B x;
explicit15.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+class C
+{
+ template
+ friend void f(T)
+ {
+ C c;
+ c.i = 3;
+ }
+
+ int i;
+};
+
+
+int main()
+{
+ f(7);
+}
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: enum9.C
===================================================================
--- enum9.C (nonexistent)
+++ enum9.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+template
+class _Format_cache
+{
+public:
+ enum {
+ _S_digits, _S_digits_end = _S_digits+10,
+ _S_xdigits = _S_digits_end
+ };
+};
+
+template class _Format_cache;
enum9.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: inject2.C
===================================================================
--- inject2.C (nonexistent)
+++ inject2.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-Wno-non-template-friend" }
+// Origin: Mark Mitchell
+
+template
+class C {
+ friend void f(struct X *);
+};
+
+template class C<0>;
+
+class D {
+ friend void f(struct X*);
+};
+
inject2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// Based on bug report by Miniussi
+
+class t {};
+
+template struct A { typedef T t; typedef T u; };
+
+template struct B : public A {
+ // according to [temp.dep.type], `t' and `u' cannot be dependent types,
+ // and so there's no reason to delay lookup to specialization time.
+ void f(t p); // this is ::t [temp.dep]/3
+ void f(typename A::t p); // { dg-bogus "" } redefinition
+ void g(u p); // { dg-error "" } unknown type name
+};
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 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+template class DD
+{
+};
+
+template class D
+{
+};
+
+template class D,class E> class C
+{
+ D d;
+};
+
+int main()
+{
+ C
c;
+}
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: nested1.C
===================================================================
--- nested1.C (nonexistent)
+++ nested1.C (revision 154)
@@ -0,0 +1,47 @@
+// { dg-do assemble }
+
+template
+struct X
+{
+ T1 a;
+
+ struct Y
+ {
+ T2 x;
+ Y (T2 _x) { x=_x; }
+ };
+
+};
+
+template
+struct X
+{
+ T1 a;
+
+ struct Y
+ {
+ int x;
+ Y (int _x) { x=_x; }
+ };
+
+};
+
+template <>
+struct X
+{
+ int a;
+
+ struct Y
+ {
+ int x;
+ Y (int _x) { x=_x; }
+ };
+
+};
+
+void f ()
+{
+ X t1;
+ X t2;
+ X t3;
+}
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: debug1.C
===================================================================
--- debug1.C (nonexistent)
+++ debug1.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+// Origin: Jim Wilson
+
+template class _Oper,
+ template class _Meta1,
+ template class _Meta2,
+ class _Dom1, class _Dom2> class _BinClos;
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: ttp12.C
===================================================================
--- ttp12.C (nonexistent)
+++ ttp12.C (revision 154)
@@ -0,0 +1,29 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class E,class D> class C
+{
+ E d;
+ public:
+ int f();
+};
+
+template class E,class D> int C::f()
+{
+ return d.f();
+}
+
+int main()
+{
+ C c;
+ c.f();
+}
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: memtemp61.C
===================================================================
--- memtemp61.C (nonexistent)
+++ memtemp61.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do link }
+// GROUPS passed membertemplates
+struct S
+{
+ template
+ void foo(T t);
+};
+
+
+template <>
+void S::foo(int i)
+{
+}
+
+
+int main()
+{
+ S s;
+ s.foo(3);
+}
memtemp61.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp44.C
===================================================================
--- memtemp44.C (nonexistent)
+++ memtemp44.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+template
+class A
+{
+};
+
+template<>
+class A
+{
+public:
+ template
+ void func(U v1) {}
+};
+
+int main()
+{
+ A a;
+ a.func(3);
+}
memtemp44.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,70 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001
+
+// Origin: gustavo@geneura.ugr.es
+// Bug 3624. Template instantiation of a reference type was not
+// converted from reference when doing a call.
+
+#include
+
+using namespace std;
+
+template class eo: public A
+{
+public:
+ eo()
+ {
+ cout << this->x << " " << this->y << " "
+ << c(*this) << " "
+ << ((d)?"true":"false") << endl;
+ }
+
+private:
+ B b;
+};
+
+struct XY
+{
+ float x, y;
+
+ XY(): x(1), y(0.1) {}
+};
+
+float fitness(const XY& a)
+{
+ return a.x + a.y;
+}
+
+struct fitness2
+{
+ float operator()(const XY& a)
+ {
+ return a.x - a.y;
+ }
+
+ float f(const XY& a)
+ {
+ return a.x - a.y;
+ }
+};
+
+struct fitness3
+{
+ float operator()(const XY& a)
+ {
+ return a.x / a.y;
+ }
+};
+
+fitness2 f2;
+fitness3 f3;
+
+int main()
+{
+ eo eo2;
+ eo eo3;
+
+ return 0;
+}
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: t37a.C
===================================================================
--- t37a.C (nonexistent)
+++ t37a.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+class A {
+public:
+ A(int);
+ A(float);
+ ~A();
+};
+
+A::A(float f) {
+}
+
+A::A(int i) {
+}
+
+A::~A() {
+}
+
t37a.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,25 @@
+// { dg-do run }
+template
+class b
+{
+private:
+ char a(int x)
+ {
+ union {
+ int i;
+ char c;
+ } val;
+ val.i = x;
+ return val.c;
+ };
+
+public:
+ b() {
+ }
+};
+
+int main() {
+ b n;
+ return 0;
+}
+
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 154)
@@ -0,0 +1,33 @@
+// { dg-do run }
+// Origin: Mark Mitchell
+
+int i;
+
+template
+struct S {
+ S() { ++i; }
+
+ virtual void g() {}
+ virtual void f();
+
+ static S s;
+};
+
+template
+void S::f() {
+ s.f();
+}
+
+S si;
+
+template
+S S::s;
+
+int main ()
+{
+ si.g();
+ if (i != 2)
+ return 1;
+ else
+ return 0;
+}
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 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+typedef const int cint;
+
+template
+class A
+{
+public:
+ T f(cint i);
+};
+
+template
+T A::f(cint i)
+{
+}
+
+int main()
+{
+ A a;
+}
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: typename21.C
===================================================================
--- typename21.C (nonexistent)
+++ typename21.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell
+
+template
+struct S1 {
+ typedef T X;
+};
+
+template
+struct B {
+ typedef T I;
+};
+
+template
+struct S2 : public B {
+ struct I {};
+
+ typedef typename S1::X IX;
+
+ void f(IX);
+};
+
+template
+void S2::f(IX) {}
typename21.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit41.C
===================================================================
--- explicit41.C (nonexistent)
+++ explicit41.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+template
+void f(int i);
+
+void g()
+{
+ int i;
+ f(7); // { dg-error "" } template argument 1 is invalid.
+}
explicit41.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit24.C
===================================================================
--- explicit24.C (nonexistent)
+++ explicit24.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+int foo(T t);
+
+int foo(int i) { return 0; } // { dg-error "" } missing template <>
+
explicit24.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+void f (int i)
+{
+ struct S { void g (int j = i) {} }; // { dg-error "" } default argument uses local
+
+ S s;
+}
+
+template void f(int);
+
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: parse2.C
===================================================================
--- parse2.C (nonexistent)
+++ parse2.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template struct A {
+ A (const A&) { }
+};
+
+template A::A (const A&);
parse2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: vaarg.C
===================================================================
--- vaarg.C (nonexistent)
+++ vaarg.C (revision 154)
@@ -0,0 +1,29 @@
+// { dg-do run }
+#include
+
+extern "C" void abort();
+
+template
+T* f(T t, ...)
+{
+ va_list ap;
+
+ va_start(ap, t);
+ T* r = va_arg(ap, T*);
+ va_end(ap);
+
+ return r;
+}
+
+
+struct S
+{
+};
+
+int main()
+{
+ S s;
+
+ if (f(s, &s) != &s)
+ abort();
+}
vaarg.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: expr3.C
===================================================================
--- expr3.C (nonexistent)
+++ expr3.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+template
+struct S {};
+
+template
+void foo(S);
+
+template
+void baz(S);
+
+template
+void fun(S, S);
+
+void bar()
+{
+ foo<5>(S<4>()); // OK - 4 is 5 - 1.
+ baz(S()); // OK
+ fun(S<4>(), S<8>()); // OK - deduce J from first argument.
+}
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: crash10.C
===================================================================
--- crash10.C (nonexistent)
+++ crash10.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+template
+class GCD {
+public:
+ enum { val = (N == 0) ? M : GCD::val }; // { dg-error "" } division
+};
+
+int main() {
+ GCD< 1, 0 >::val; // { dg-error "" } instantiated
+}
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: explicit1.C
===================================================================
--- explicit1.C (nonexistent)
+++ explicit1.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t) {}
+
+void bar()
+{
+ (void (*)(double)) &foo;
+}
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: spec37.C
===================================================================
--- spec37.C (nonexistent)
+++ spec37.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Jan 2001
+
+// Bug 1728. We started sorting things when there were 7 fields. Our
+// template_count algorithm was rather fragile ...
+
+template struct X
+{
+ struct Y
+ {
+ int x1;
+ int x2;
+ int x3;
+ int x4;
+ int x5;
+ int x6;
+ int x7;
+
+ void Foo ();
+ };
+};
+
+template <> void X<1>::Y::Foo () {}
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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ S(const T&) {}
+ S(int, long);
+};
+
+template S::S(const double&);
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: defarg2.C
===================================================================
--- defarg2.C (nonexistent)
+++ defarg2.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do run }
+template
+struct X
+{};
+
+template <>
+struct X<0,int>
+{};
+
+template
+struct X
+: X<>
+{};
+
+int main()
+{
+ X<1,int> x;
+}
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 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C : D
+{
+ public:
+ int g();
+};
+
+template class D,class E> int C::g()
+{
+ return this->f();
+}
+
+class E : C
+{
+ public:
+ int h() { return this->g(); }
+};
+
+int main()
+{
+ E c;
+ c.h();
+}
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: memtemp70.C
===================================================================
--- memtemp70.C (nonexistent)
+++ memtemp70.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+template
+class X {
+public:
+ T x;
+};
+
+class Y {
+public:
+ template static void f(X& a) {}
+
+ void g(void);
+};
+
+void
+Y::g(void)
+{
+ X a;
+
+ f(a);
+}
+
+
memtemp70.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp53.C
===================================================================
--- memtemp53.C (nonexistent)
+++ memtemp53.C (revision 154)
@@ -0,0 +1,36 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+template
+struct I {
+};
+
+template
+struct A {
+
+ int r;
+
+ template
+ void operator()(T1, T2)
+ { r = 0; }
+
+ template
+ void operator()(I, I)
+ { r = 1; }
+};
+
+int main()
+{
+ A x;
+ I<0> a;
+ I<1> b;
+
+ x(a,b);
+ if (x.r != 1)
+ return 1;
+
+ x(float(), double());
+ if (x.r != 0)
+ return 1;
+
+ return 0;
+}
memtemp53.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp36.C
===================================================================
--- memtemp36.C (nonexistent)
+++ memtemp36.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct R
+{
+};
+
+
+template
+struct S
+{
+ template
+ S(R r);
+};
+
+
+void foo()
+{
+ R r;
+ S s(r);
+}
memtemp36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp19.C
===================================================================
--- memtemp19.C (nonexistent)
+++ memtemp19.C (revision 154)
@@ -0,0 +1,25 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template
+ operator T();
+};
+
+template
+S::operator T()
+{
+ printf("Hello, world.\n");
+ return T();
+}
+
+
+template S::operator int();
+
+int main()
+{
+ S s;
+
+ int i = s.operator int();
+}
memtemp19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t39.C
===================================================================
--- t39.C (nonexistent)
+++ t39.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+extern "C" int printf (const char *, ...);
+
+template
+struct frob {
+ T *ptr;
+ void print ();
+ frob (T* init) { ptr = init; }
+};
+
+template
+void frob::print () {
+ printf ("this = %08x\n", this);
+ printf (" ptr = %08x\n", ptr);
+ printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
+}
+
+ static int x[10];
+ frob fc ("hello");
+ frob fi (x);
+
+int main () {
+ fc.print ();
+ fi.print ();
+ return 0;
+}
t39.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+// Test that partial ordering works between conversion ops from different
+// classes.
+// From Jason Merrill
+
+struct A {
+ template operator T*() { return 0; }
+};
+struct B : public A {
+ template operator T();
+};
+
+int main()
+{
+ B b;
+ (void*) b;
+}
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: explarg1.C
===================================================================
--- explarg1.C (nonexistent)
+++ explarg1.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Bug: g++ generates an error trying to generate the first foo, when
+// it should silently fail and go on to the next one.
+
+template class A { };
+
+template void
+foo(const A&);
+
+template
+class B { };
+
+template void
+foo(B const &) { }
+
+int
+main(void)
+{
+ B sa;
+
+ foo (sa);
+}
deduct1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do run }
+template struct B { };
+
+template struct A {
+ template int operator () (U u, V v);
+ template void operator () (B u, B v) { }
+};
+
+int
+main ()
+{
+ A a;
+ B b1;
+ B b2;
+ a (b1, b2);
+}
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: defarg14.C
===================================================================
--- defarg14.C (nonexistent)
+++ defarg14.C (revision 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Origin: Larry Evans
+
+// Bug: enum in default template arguments are not properly handled.
+
+enum Enum0 { E0, E1, E2 };
+enum Enum1 { E3=E2+1, E4=E3+1 };
+
+template class OutTmpl
+{
+ public:
+ template class InTmpl
+ {
+ };
+};
+
+OutTmpl m;
defarg14.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+class A
+{
+ class A_impl;
+ public:
+ A(){}
+};
+
+
+template class A::A_impl // { dg-error "does not declare a template" }
+{
+};
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: explicit2.C
===================================================================
--- explicit2.C (nonexistent)
+++ explicit2.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t) {}
+
+void bar()
+{
+ (void (*)(int)) (void (*)(double)) &foo;
+}
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: spec38.C
===================================================================
--- spec38.C (nonexistent)
+++ spec38.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 19 Jan 2001
+
+// Bug 1638. We failed to check if a function instantiation produced a void
+// parameter type.
+
+template struct S
+{
+ int f (T); // { dg-error "" } void type
+};
+
+void foo ()
+{
+ S s;
+}
memclass10.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: syntax1.C
===================================================================
--- syntax1.C (nonexistent)
+++ syntax1.C (revision 154)
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 June 2000
+
+// Origin GNATS bug report 262 from Jeremy Sanders
+// and several others. With templates, it's very easy to say something
+// erroneous like
+// template class X::X
+// The culprit
+// ... class X::X ...
+// caused us to ICE as we got confused about pushing and popping scopes.
+
+
+
+class Y
+{
+ public:
+ template Y(T &);
+};
+template Y::Y(T &) {}
+
+template class Y::Y (int); // { dg-error "" } parse error
+template Y::Y (int); // { dg-error "" } template-id does not match
+template Y::Y (int &);
+
syntax1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,30 @@
+// { dg-do link }
+// { dg-options "-frepo -Werror" }
+// Build then link:
+
+
+// Submitted by Melissa O'Neill
+// the vtable of Foo wouldn't be generated
+
+template
+struct Foo {
+ virtual void foo() {}
+};
+
+template
+struct Bar {
+ void bar();
+};
+
+template
+void Bar::bar() {
+ Foo oof;
+}
+
+int main () {
+ Bar rab;
+
+ rab.bar();
+}
+
+// { dg-final { cleanup-repo-files } }
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: defarg3.C
===================================================================
--- defarg3.C (nonexistent)
+++ defarg3.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+template
+struct S;
+
+template
+struct S {};
+
+template
+struct S;
+
+void f()
+{
+ S<> s;
+}
+
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: ttp22.C
===================================================================
--- ttp22.C (nonexistent)
+++ ttp22.C (revision 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class DD,class EE> class C : DD
+{
+ public:
+ int f();
+};
+
+template class DD,class EE> int C
::f()
+{
+ return DD::f();
+}
+
+class E : C
+{
+ public:
+ int f() { return C::f(); }
+};
+
+int main()
+{
+ E c;
+ c.f();
+}
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: memtemp71.C
===================================================================
--- memtemp71.C (nonexistent)
+++ memtemp71.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+class A
+{
+ templateT epsilon; // { dg-error "" } invalid member template
+};
memtemp71.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp37.C
===================================================================
--- memtemp37.C (nonexistent)
+++ memtemp37.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ template
+ void f(U u);
+};
+
+
+template
+template
+void S::f(U)
+{
+}
+
+enum
+{
+ a = 3
+};
memtemp37.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Origin: Gabriel Dos Reis
+
+// Bug 29. We failed to verify that template argument deduction
+// produces a valid result in nondeduce context.
+
+template struct Y { typedef T X; };
+
+template struct Base {};
+
+template struct Base {};
+
+template struct Base {};
+
+template struct Derived : Base {};
+
+struct A {};
+
+template struct Derived : Base< Y, Y > {};
+
+int main()
+{
+ Derived d;
+}
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: crash4.C
===================================================================
--- crash4.C (nonexistent)
+++ crash4.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+template
+class Tensor
+{
+};
+
+template
+class Tensor<2> : Tensor { // { dg-error "" } template parameters not used
+};
+
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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated" }
+
+template
+struct B {
+ typedef T X;
+};
+
+template
+struct S : public B
+{
+ struct I {
+ void f(X x); // { dg-warning "" } implicit typename
+ };
+};
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: explicit51.C
===================================================================
--- explicit51.C (nonexistent)
+++ explicit51.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template int fact ()
+{
+ return 0;
+}
+
+template <> int fact<1> ()
+{
+ return 1;
+}
+
+int main()
+{
+ if (fact<3> () != 0 || fact<1> () != 1
+ || fact<3> () != 0 || fact<1> () != 1 || fact<1+0> () != 1)
+ abort ();
+}
explicit51.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit34.C
===================================================================
--- explicit34.C (nonexistent)
+++ explicit34.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t);
+
+template <>
+void foo(int) {}; // { dg-error "" } previously defined here.
+
+template <>
+void foo(int) {} // { dg-error "" } duplicate specialization.
explicit34.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass5.C
===================================================================
--- memclass5.C (nonexistent)
+++ memclass5.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do run }
+template struct A {
+ template struct B {
+ template static void f () { }
+ void g () { }
+ };
+};
+
+template
+void f ()
+{
+ A::template B::template f ();
+ typename A::template B b;
+ typename A::template B b2;
+ b.A::template B::~B();
+}
+
+template struct C: public A::template B { };
+
+int main ()
+{
+ f();
+}
memclass5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit17.C
===================================================================
--- explicit17.C (nonexistent)
+++ explicit17.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+template
+void foo(U u, T t);
+
+template
+void foo(T t);
+
+template
+struct S {};
+
+template
+void foo(const S&);
+
+void bar()
+{
+ void (*fn)(double, int) =
+ (void (*)(double, int)) &foo;
+ void (*fn2)(double) = foo;
+ foo(3, 3.0);
+ foo(S());
+}
explicit17.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,26 @@
+// { dg-do run }
+template
+void f(T);
+
+template
+class C
+{
+ template
+ friend void f(T);
+
+ int i;
+};
+
+
+template
+void f(T)
+{
+ C c;
+ c.i = 3;
+}
+
+
+int main()
+{
+ f(7);
+}
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: lookup8.C
===================================================================
--- lookup8.C (nonexistent)
+++ lookup8.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+class X{};
+
+class Y : public X
+{
+ void f();
+};
+
+void Y::f()
+{
+ X x; // { dg-error "" } X is not a type.
+}
pointer1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+template
+struct A { // { dg-error "assignment" }
+ const T x;
+ A() : x(0) { } A(T x) : x(x) { }
+};
+
+template
+void func ()
+{
+ B y;
+ y = B(); // { dg-error "synthesized" }
+}
+
+int main (void) { func< A<> >(); }
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: shadow2.C
===================================================================
--- shadow2.C (nonexistent)
+++ shadow2.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Jason Merrill
+
+template struct A { // { dg-error "" } shadowed parameter
+ struct B {
+ void T(); // { dg-error "" } shadows template parameter
+ };
+};
+A a;
+
shadow2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+template
+class C;
+
+template
+struct S
+{
+ template
+ void f(U u)
+ {
+ C cu;
+ cu.i = 3; // { dg-error "" } S::f is a friend, but this is
+ // S::f.
+ }
+};
+
+
+template
+class C
+{
+ template
+ friend void S::f(U);
+
+ int i; // { dg-error "" } private
+};
+
+
+int main()
+{
+ S si;
+ si.f(3.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: ttp31.C
===================================================================
--- ttp31.C (nonexistent)
+++ ttp31.C (revision 154)
@@ -0,0 +1,33 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+extern "C" void abort();
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ int f() { abort(); return 0; }
+};
+
+template class F> class C
+{
+ F d;
+ public:
+ int f() { return d.f(); }
+};
+
+int main()
+{
+ C c;
+ c.f();
+}
ttp31.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp80.C
===================================================================
--- memtemp80.C (nonexistent)
+++ memtemp80.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+template T baz() { return 0; }
+
+struct foo {
+ template static T staticbar() { return 0; }
+ template T bar() { return 0; }
+};
+
+void f()
+{
+ foo t;
+ int i = baz();
+ int j = foo::staticbar();
+ int k = t.bar();
+}
memtemp80.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,31 @@
+// { dg-do run }
+template class D
+{
+ T a;
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class DD = D> class C
+{
+ DD d;
+ public:
+ int f();
+};
+
+template class DD> int C::f()
+{
+ DD d2;
+ return d2.f();
+}
+
+int main()
+{
+ C c;
+ c.f();
+}
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: memtemp63.C
===================================================================
--- memtemp63.C (nonexistent)
+++ memtemp63.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do run }
+template struct A {
+ template void f (U u);
+};
+
+A a;
+
+template template void A::f (U u) { }
+
+int main()
+{
+ a.f (24);
+}
+
memtemp63.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp46.C
===================================================================
--- memtemp46.C (nonexistent)
+++ memtemp46.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+template
+class A
+{
+};
+
+template
+class A
+{
+public:
+ template
+ void func(V v1 = 0) {}
+};
+
+int main()
+{
+ A a;
+ a.func("abc");
+}
memtemp46.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp29.C
===================================================================
--- memtemp29.C (nonexistent)
+++ memtemp29.C (revision 154)
@@ -0,0 +1,32 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+template
+struct S
+{
+ template
+ void f(U u);
+
+ template
+ void g(U U);
+
+ int c[16];
+};
+
+template
+template
+void S::f(U u)
+ { printf ("In S::f(U)\n"); g(u); }
+
+template
+template
+void S::g(U u)
+ { printf ("In S::g(U)\n"); }
+
+int main()
+{
+ S s;
+ s.f(3);
+ s.f("adf");
+}
memtemp29.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local7.C
===================================================================
--- local7.C (nonexistent)
+++ local7.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+template inline STRUCT *
+setback(MEMBER *bp, MEMBER STRUCT::*offset)
+{
+ if(!bp) return 0;
+ union { int i; MEMBER STRUCT::*of; } u;
+ u.of = offset;
+ return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
+}
+
+
+struct S
+{
+ int i;
+};
+
+int main()
+{
+ S s;
+
+ S* sp = setback (&s.i, &S::i);
+}
local7.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+struct B1 {
+ typedef int X;
+};
+
+struct B2 {
+ typedef int X;
+};
+
+template
+struct D : public B1, public B2 {
+ typedef int X;
+};
+
+template struct D;
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: infinite1.C
===================================================================
--- infinite1.C (nonexistent)
+++ infinite1.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "-ftemplate-depth-10" }
+// Test for catching infinitely recursive instantiations.
+// Origin: Jason Merrill
+
+
+template void f()
+{
+ f(); // { dg-error "" } excessive recursion
+}
+
+// We should never need this specialization because we should issue an
+// error first about the recursive template instantions. But, in case
+// the compiler fails to catch the error, this will keep it from
+// running forever instantiating more and more templates.
+template <> void f<11>();
+
+int main()
+{
+ f<0>();
+}
infinite1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,25 @@
+// { dg-do link }
+// { dg-options "-frepo" }
+// Test that collect2 isn't confused by GNU ld's "In function `foo':" message.
+// Contributed by Jason Merrill
+
+// Build then link:
+
+template
+T f (T t)
+{
+ return t;
+}
+
+template
+T g (T t)
+{
+ return f (t);
+}
+
+int main ()
+{
+ int i = g (42);
+}
+
+// { 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: explicit60.C
===================================================================
--- explicit60.C (nonexistent)
+++ explicit60.C (revision 154)
@@ -0,0 +1,44 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template void f ();
+template void g ()
+{
+ abort ();
+}
+
+template <> void g ()
+{
+ abort ();
+}
+
+template class C
+{
+ public:
+ void ff () { f (); }
+ void gg () { g (); }
+ template void f () {}
+ template void g () {}
+ template void f (int) { abort(); }
+ template void g (int) { abort(); }
+};
+
+template void f ()
+{
+ abort ();
+}
+
+template <> void f ()
+{
+ abort ();
+}
+
+int main ()
+{
+ C c;
+ c.ff();
+ c.gg();
+ C d;
+ d.ff();
+ d.gg();
+}
explicit60.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename23.C
===================================================================
--- typename23.C (nonexistent)
+++ typename23.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+template
+void value_type(T){}
+
+template
+struct B{
+ typedef T value_type;
+};
+
+templateclass Vector{};
+
+template
+struct D:B{
+ Vector r; // { dg-error "" } value_type is not a type
+};
typename23.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit43.C
===================================================================
--- explicit43.C (nonexistent)
+++ explicit43.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do run }
+extern "C" void abort(void);
+
+void F(int)
+{
+}
+
+
+void F(double)
+{
+ abort();
+}
+
+template
+void g()
+{
+ (*F)(3);
+}
+
+
+int main()
+{
+ g<&F>();
+}
explicit43.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit26.C
===================================================================
--- explicit26.C (nonexistent)
+++ explicit26.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do link }
+// GROUPS passed templates
+template
+int foo(T t) { return 1; }
+
+template <>
+int foo(int i) { return 0; }
+
+int main()
+{
+ (int (*)(int)) &foo;
+}
explicit26.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: deduct2.C
===================================================================
--- deduct2.C (nonexistent)
+++ deduct2.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sept 2000
+
+// bug 79 & 59. We failed to tsubst non-type template parms which used
+// (previously deduced) type parms.
+
+struct C {};
+
+template< class T, T *G > struct S {};
+template< class T, T *G > void boz ( S s1);
+
+C c1Gen;
+
+void foo ()
+{
+ S< C, &c1Gen > s1;
+
+ boz (s1);
+}
deduct2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+template
+class foo
+{
+public:
+ typedef X y;
+
+ class bar {
+ public:
+ void blah () { y Y; }
+ };
+};
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: goto2.C
===================================================================
--- goto2.C (nonexistent)
+++ goto2.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+int i = 1;
+
+template void test()
+{
+ goto lab;
+ lab:
+ --i;
+}
+
+int main ()
+{
+ test();
+ return i;
+}
goto2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+template
+class C
+{
+public:
+ C O();
+ C O() const;
+};
+
+
+int
+main()
+{
+ C c;
+ char* p = Z(c.O); //{ dg-error "" } ambiguous c.O
+}
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: asm1.C
===================================================================
--- asm1.C (nonexistent)
+++ asm1.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
+// We'd use ebx with -fpic/-fPIC, so skip.
+// { dg-skip-if "" { ilp32 } { "-fpic" "-fPIC" } { "" } }
+// Origin: "Weidmann, Nicholas"
+
+template int foo(int v)
+{
+ __asm__ __volatile__("addl %1, %0" : "=a" (v) : "b" (i));
+
+ return v;
+}
+
+int bar(int i)
+{
+ return foo<123>(i);
+}
+
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: crash12.C
===================================================================
--- crash12.C (nonexistent)
+++ crash12.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+
+template
+class CenteringTag {
+};
+
+struct S {
+ template
+ static void f() {
+ CenteringTag ctag;
+ }
+};
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: expr5.C
===================================================================
--- expr5.C (nonexistent)
+++ expr5.C (revision 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+template
+struct S1;
+
+template
+struct S2
+{
+ typedef typename S1= j ? 0 : 1) >::type type;
+};
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: explicit3.C
===================================================================
--- explicit3.C (nonexistent)
+++ explicit3.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t, U u) {}
+
+void bar()
+{
+ (void (*)(double, int)) &foo;
+}
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: memclass11.C
===================================================================
--- memclass11.C (nonexistent)
+++ memclass11.C (revision 154)
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+struct S1
+{
+ template
+ struct S2;
+
+ template
+ struct S2 {
+ enum E { a };
+ };
+};
+
+int i = (int) S1::S2::a;
memclass11.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: spec39.C
===================================================================
--- spec39.C (nonexistent)
+++ spec39.C (revision 154)
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 19 Jan 2001
+
+// Bug 1656. We failed to make sure that a template-id was built
+// from a primary template.
+
+template struct Outer
+{
+ struct Inner {};
+
+ void f()
+ {
+ Inner i; // { dg-error "" } non-template
+ Inner<> j; // { dg-error "" } non-template
+ }
+};
+struct O {};
+void foo ()
+{
+ Outer<1> x;
+ x.f ();
+ Outer<1>::Inner<2> z; // { dg-error "" } non-template
+ O<1> w; // { dg-error "" } non-template
+}
+
+template class TPL>
+struct X
+{
+ TPL t;
+ T s; // { dg-error "" } non-template
+};
+
+template struct Y
+{
+};
+
+void bar ()
+{
+ X a;
+ X b; // { dg-error "" } non-template
+}
spec39.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,13 @@
+// { dg-do link }
+// { dg-additional-sources " instantiate5.cc instantiate5-main.cc" }
+
+// `global constructors' are given the same name, based on foo(), on
+// both translation units, which is wrong, because it must be possible
+// to define template functions in multiple translation units, as long
+// as they're given the same definition
+
+// simplified from test case submitted by Daniel X. Pape
+
+template void foo() { }
+inline int bar() { foo(); return 1; }
+static int i = bar();
memtemp100.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: stmtexpr.C
===================================================================
--- stmtexpr.C (nonexistent)
+++ stmtexpr.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+extern "C" void abort();
+
+template
+T f(T)
+{
+ T t = __extension__ ({ T j = 4; j + 3; });
+ return t;
+}
+
+
+int main()
+{
+ if (f(3) != 7)
+ abort();
+}
+
stmtexpr.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,34 @@
+// { dg-do link }
+// { dg-options "-frepo" }
+// Test that we properly generate the vtable and such for C.
+// Contributed by scott snyder
+
+// Build then link:
+
+struct A
+{
+ virtual ~A () {}
+};
+
+template
+struct B : virtual public A
+{
+ virtual void foo () {}
+};
+
+template
+struct C : virtual public A
+{
+};
+
+template
+struct D : public B, public C
+{
+};
+
+main ()
+{
+ D x;
+}
+
+// { 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: explicit61.C
===================================================================
--- explicit61.C (nonexistent)
+++ explicit61.C (revision 154)
@@ -0,0 +1,44 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template void f ();
+template void g ()
+{
+ abort ();
+}
+
+template <> void g ()
+{
+ abort ();
+}
+
+template class C
+{
+ public:
+ void ff () { f (0); }
+ void gg () { g (1); }
+ template void f () { abort(); }
+ template void g () { abort(); }
+ template void f (int) {}
+ template void g (int) {}
+};
+
+template void f ()
+{
+ abort ();
+}
+
+template <> void f ()
+{
+ abort ();
+}
+
+int main ()
+{
+ C c;
+ c.ff();
+ c.gg();
+ C d;
+ d.ff();
+ d.gg();
+}
asm2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+extern "C" int printf(const char *, ...);
+template struct A {
+ typedef typename T::X B; // { dg-error "" } not a class
+ A(double);
+};
+
+template void xxx(typename A::B);
+
+template struct B {
+ friend void xxx(T); // { dg-error "" } does not match any template
+};
+
+template struct B;
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: crash13.C
===================================================================
--- crash13.C (nonexistent)
+++ crash13.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template struct A {};
+template struct A; // { dg-error "" } does not specialize args
+template const struct A; // { dg-error "" } parse error
+template template A; // { dg-error "" } .*
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: expr6.C
===================================================================
--- expr6.C (nonexistent)
+++ expr6.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+// Based on a bug report by tveldhui
+
+template class foo {};
+
+foo< true ? 1 : 0 > bar;
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: explicit4.C
===================================================================
--- explicit4.C (nonexistent)
+++ explicit4.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// GROUPS passed templates
+template
+void foo(T t);
+
+template
+struct S {};
+
+template
+void bar(T t)
+{
+ void (*f)(S ) = &foo >;
+}
+
+
+void baz()
+{
+ bar(3);
+}
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: memclass12.C
===================================================================
--- memclass12.C (nonexistent)
+++ memclass12.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+struct outer {
+ template struct inner;
+} o;
+template struct outer::inner {};
memclass12.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,28 @@
+// { dg-do link }
+// { dg-options "-frepo" }
+// Build then link:
+
+// Simplified from testcase by Erez Louidor Lior
+
+template
+class foo{
+public:
+ void g();
+ void h();
+};
+
+template
+void foo::g() {
+ h();
+}
+
+template
+void foo::h() {
+}
+
+int main() {
+ foo f;
+ f.g();
+}
+
+// { dg-final { cleanup-repo-files } }
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: friend21.C
===================================================================
--- friend21.C (nonexistent)
+++ friend21.C (revision 154)
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+
+template struct A {
+ static void f();
+};
+
+template class B
+{
+ friend class A;
+ static int i; // { dg-error "" } private
+};
+
+template class C
+{
+ template
+ friend class A;
+
+ static int i;
+};
+
+template
+void A::f()
+{
+ B::i = 3;
+ C::i = 3;
+ C::i = 3;
+ B::i = 3; // { dg-error "" } member `i' is private
+}
+
+template void A::f();
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: ttp41.C
===================================================================
--- ttp41.C (nonexistent)
+++ ttp41.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do compile }
+template class D,class E> class C
+{
+ public:
+ int g() { return 1; }
+};
+
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ C c; // { dg-error "" }
+ return c.g(); // { dg-error "" }
+}
+
+int main()
+{
+ D d;
+ d.f();
+}
ttp41.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,23 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> int f()
+{
+ D d;
+ return d.f();
+}
+
+int main()
+{
+ f();
+ f();
+}
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: memtemp90.C
===================================================================
--- memtemp90.C (nonexistent)
+++ memtemp90.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// regression test -
+
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+// related to bug report by Leon Bottou
+
+struct A {
+ template
+ struct B {
+ };
+ template
+ struct C {
+ B b; // { dg-bogus "" } B is not a template
+ // but removing wrapper A gets rid of complaint
+ // also, replacing B with A::B also gets rid of complaint
+ };
+};
+
memtemp90.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+template
+class Point {
+ public:
+ Point (Point &);
+ Point & operator = (Point &);
+};
+
+
+
+template
+class bar{
+ public:
+ void foo (Point p = Point());
+};
+
+
+
+template <>
+void bar<2>::foo (Point<2> p) {
+ const int dim = 2;
+ Point q = p;
+}
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: memtemp73.C
===================================================================
--- memtemp73.C (nonexistent)
+++ memtemp73.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do run }
+template struct A {
+ template void f(U);
+};
+
+template struct B { };
+
+template template
+void A::f (U)
+{
+ enum { foo };
+ B b;
+}
+
+int main ()
+{
+ A a;
+ a.f (42);
+}
memtemp73.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp56.C
===================================================================
--- memtemp56.C (nonexistent)
+++ memtemp56.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+class TinyVector {};
+
+template
+struct Array
+{
+ template
+ Array() {}
+
+ template
+ P_numtype operator()(const TinyVector& index) const {}
+};
+
memtemp56.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp39.C
===================================================================
--- memtemp39.C (nonexistent)
+++ memtemp39.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct S
+{
+ template
+ void f(U u) { g(u); }
+
+ template
+ void g(U u) { f(u); }
+};
+
+void foo()
+{
+ S si;
+ si.f(3);
+}
memtemp39.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Nov 2000
+
+// Inspired by by 756. We'd ICE when trying to define a member of an
+// incomplete template type.
+
+template struct ObjCount;
+
+template int ObjCount::m; // { dg-error "" } undefined type
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: codegen1.C
===================================================================
--- codegen1.C (nonexistent)
+++ codegen1.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+int i;
+
+struct S
+{
+ ~S ()
+ {
+ }
+};
+
+template
+void f (T, S)
+{
+ i = 0;
+}
+
+int main ()
+{
+ i = 1;
+ f (3, S ());
+ return i;
+}
codegen1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp1.C
===================================================================
--- memtemp1.C (nonexistent)
+++ memtemp1.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+struct S {
+ template
+ void foo(T&);
+};
+
+
+template
+void S::foo(T&)
+{
+}
+
+
+
memtemp1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+template class List;
+
+template
+struct ListIterator
+{
+ ListIterator ();
+ ListIterator (const ListIterator& rhs);
+};
+
+template
+struct List
+{
+ void length () const {
+ for (ListIterator li; li; ); // { dg-error "" } used where a `bool'
+ }
+};
+
+void test(List& vals)
+{
+ vals.length();
+}
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: explicit70.C
===================================================================
--- explicit70.C (nonexistent)
+++ explicit70.C (revision 154)
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+
+template
+void f(T) {}
+
+template
+struct S {
+ static T t;
+};
+
+template
+T S::t;
+
+template void f(int);
+template void f(int); // { dg-error "" } duplicate explicit instantiation
+template int S::t;
+template int S::t; // { dg-error "" } duplicate explicit instantiation
+template class S;
+template class S; // { dg-error "" } duplicate explicit instantiation
+
+extern template void f(double); // { dg-warning "" } extern not allowed
+inline template class S; // { dg-warning "" } inline not allowed
+
+template
+struct S {};
+
+template class S; // OK - explicit instantiation of partial
+ // specialization
+
+template <>
+struct S {};
+
+template class S; // OK - explicit instantiation after
+
+template <>
+void f(long double) {}
+
+template void f(long double); // OK - explicit instantiation after
+
+template
+void g(T);
+
+template void g(int); // { dg-error "" } no definition of g.
explicit70.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit53.C
===================================================================
--- explicit53.C (nonexistent)
+++ explicit53.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template inline int fact ();
+template <> inline int fact<1> ();
+
+template inline int fact ()
+{
+ return a * fact ();
+}
+
+template <> inline int fact<1> ()
+{
+ return 1;
+}
+
+int main()
+{
+ if (fact<3> () != 6 || fact<1> () != 1
+ || fact<3> () != 6 || fact<1> () != 1 || fact<1+0> () != 1)
+ abort ();
+}
explicit53.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,31 @@
+// { dg-do link }
+// { dg-options "-Wno-deprecated" }
+
+struct B {
+ typedef int I;
+};
+
+template
+struct D1 : public B {
+};
+
+template
+struct D2 : public D1 {
+ I i; // { dg-error "" } not a type
+};
+
+template <>
+struct D1 {
+ typedef double I;
+};
+
+template
+void f(T);
+template <>
+void f(double) {}
+
+int main()
+{
+ D2 d2i;
+ f(d2i.i); // { dg-error "" } no member i
+}
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: explicit36.C
===================================================================
--- explicit36.C (nonexistent)
+++ explicit36.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do link }
+// GROUPS passed templates
+template
+void foo(T);
+
+class S {
+ friend void foo<>(int);
+
+ int i;
+};
+
+
+template <>
+void foo(int)
+{
+ S s;
+ s.i = 3;
+}
+
+
+int main()
+{
+ foo(3);
+}
explicit36.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit19.C
===================================================================
--- explicit19.C (nonexistent)
+++ explicit19.C (revision 154)
@@ -0,0 +1,13 @@
+// { dg-do link }
+// { dg-options "-ansi -pedantic-errors -w" }
+// GROUPS passed templates
+template
+int foo(T t);
+
+template <>
+int foo(int i) { return 0; }
+
+int main()
+{
+ return foo(3.0);
+}
explicit19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memclass7.C
===================================================================
--- memclass7.C (nonexistent)
+++ memclass7.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do run }
+// { dg-options "-ansi -pedantic-errors -w" }
+struct S
+{
+ template
+ struct Y {
+ template
+ void foo(T t);
+ };
+};
+
+template <>
+template <>
+void S::Y::foo(int i) { }
+
+int main()
+{
+ S::Y s;
+ s.foo(3.0);
+}
memclass7.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,23 @@
+// { dg-do run }
+template
+class C
+{
+ template
+ friend void f(T);
+
+ int i;
+};
+
+
+template
+void f(T)
+{
+ C c;
+ c.i = 3;
+}
+
+
+int main()
+{
+ f(7);
+}
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: derived1.C
===================================================================
--- derived1.C (nonexistent)
+++ derived1.C (revision 154)
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+class A
+{
+public:
+ typedef int Info;
+};
+
+template
+class B : public A
+{
+public:
+ typedef struct{
+ int a;
+ int b;
+ } Info;
+};
+
+void f()
+{
+ B::Info ie;
+ ie.a=1;
+ ie.b=2;
+}
derived1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t01.C
===================================================================
--- t01.C (nonexistent)
+++ t01.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template class B { public: A a; };
+static B b_int;
+
+int foo () { return b_int.a; }
t01.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+template
+struct S1 {};
+
+template >
+struct S2 {};
+
+template struct S2<100>; // { dg-error "" } type/value mismatch
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: typename2.C
===================================================================
--- typename2.C (nonexistent)
+++ typename2.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+class Base {
+public:
+ class Bar { public: virtual ~Bar() {}; };
+};
+
+class Derived : public Base {
+public:
+ class Bar : public Base::Bar {};
+};
+
+template
+struct XYZ : public T::Bar {
+ XYZ(): T::Bar() { }
+};
+
+void test() {
+ XYZ b;
+ XYZ d;
+}
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: memclass21.C
===================================================================
--- memclass21.C (nonexistent)
+++ memclass21.C (revision 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: kosak@cs.cmu.edu
+
+struct moo {
+ template struct cow {};
+
+ template
+ struct moo2 {
+ void func(cow &c) { }
+ };
+};
memclass21.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+template
+struct S {
+ template
+ friend X f(X, Y, Z);
+};
+
+template
+X f(X x, Y, Z) {
+ return x;
+}
+
+template char f(char, long, short);
+template char* f(char*, long*, short*);
+template class S;
+template class S;
+template double* f(double*, long*, short*);
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 154)
@@ -0,0 +1,34 @@
+// { dg-do run }
+template
+class C;
+
+template
+struct S
+{
+ template
+ void f(V v)
+ {
+ C cv;
+ cv.i = 3;
+ }
+};
+
+
+template
+class C
+{
+ template
+ template
+ friend void S::f(V);
+
+ int i;
+};
+
+
+int main()
+{
+ S si;
+ si.f(3.0);
+ S sl;
+ sl.f('c');
+}
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: ttp50.C
===================================================================
--- ttp50.C (nonexistent)
+++ ttp50.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do run }
+template class TT> class C {};
+template class D {};
+
+int main()
+{
+ C c;
+}
ttp50.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp33.C
===================================================================
--- ttp33.C (nonexistent)
+++ ttp33.C (revision 154)
@@ -0,0 +1,32 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ template class F> int f(F);
+};
+
+template class D,class E>
+template class F> int C::f(F)
+{
+ F d2;
+ return d2.f();
+}
+
+int main()
+{
+ C c;
+ D d;
+ c.f(d);
+}
ttp33.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,31 @@
+// { dg-do run }
+template class D
+{
+ T a;
+ public:
+ int f();
+};
+
+template int D::f()
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ int f();
+};
+
+template class D,class E> int C::f()
+{
+ D d2;
+ return d2.f();
+}
+
+int main()
+{
+ C c;
+ c.f();
+}
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: memtemp82.C
===================================================================
--- memtemp82.C (nonexistent)
+++ memtemp82.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+struct foo {
+ template T bar() { return staticbar( this ); }
+ template static T staticbar( foo* ) { return 0; }
+};
+
+void f()
+{
+ foo t;
+ int k = t.bar();
+}
memtemp82.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp65.C
===================================================================
--- memtemp65.C (nonexistent)
+++ memtemp65.C (revision 154)
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+template struct PartialDotProduct {
+ template
+ static T Expand(T* a, T* b) { return T(); }
+};
+
+const int N = 10;
+
+template
+void
+dot(In1 f1, In2 f2)
+{
+ PartialDotProduct::Expand(f1, f2);
+
+}
+
+int main()
+{
+ double a[N], b[N];
+
+ dot(&a[0], &b[0]);
+}
memtemp65.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp48.C
===================================================================
--- memtemp48.C (nonexistent)
+++ memtemp48.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+struct S
+{
+ template
+ void f(T t1, T t = T())
+ {}
+};
+
+
+void foo()
+{
+ S si;
+ si.f(3);
+}
memtemp48.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: m9a.C
===================================================================
--- m9a.C (nonexistent)
+++ m9a.C (revision 154)
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+
+struct A { A() { a = 1; } int a; }; // { dg-error "" }
+struct A { A() { a = 2; } int a; }; // { dg-error "" }
+A aavv;
m9a.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do link }
+// { dg-options "-frepo" }
+// Build then link:
+
+template
+struct S {
+ ~S ();
+};
+
+template
+S::~S () {}
+
+int main ()
+{
+ S s;
+}
+
+// { dg-final { cleanup-repo-files } }
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: explicit62.C
===================================================================
--- explicit62.C (nonexistent)
+++ explicit62.C (revision 154)
@@ -0,0 +1,20 @@
+// { dg-do run }
+extern "C" void abort ();
+
+template void f ()
+{
+}
+
+
+template class C
+{
+ friend void f ();
+ public:
+ void ff () { f (); }
+};
+
+int main ()
+{
+ C c;
+ c.ff();
+}
explicit62.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename25.C
===================================================================
--- typename25.C (nonexistent)
+++ typename25.C (revision 154)
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Copyright (C) 2000 Free Software Foundation
+// Adapted by Nathan Sidwell 1 July 2000
+// Derived from a bug report by scott snyder
+// Our implicit typename extension was causing this pedantically
+// correct program to fail
+
+struct list
+{
+ typedef int reference;
+};
+
+class d0_Collection_Base {};
+
+
+template
+class d0_List_1
+ : virtual public d0_Collection_Base,
+ public list
+{
+public:
+ typedef int reference;
+};
+
+template
+class d0_List
+{
+public:
+ typedef d0_List_1 Base;
+ typedef typename Base::reference reference;
+};
typename25.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit28.C
===================================================================
--- explicit28.C (nonexistent)
+++ explicit28.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do link }
+// GROUPS passed templates
+template
+int foo(T t) { return 1; }
+
+template <>
+int foo(int i) { return 0; }
+
+int main()
+{
+ return (*((int (*)(int)) &foo))(3);
+}
explicit28.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: deduct4.C
===================================================================
--- deduct4.C (nonexistent)
+++ deduct4.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do run }
+// Test that we can deduce t even though T is deduced from a later argument.
+
+template struct A { };
+
+template void f (A &, T) { }
+
+int main ()
+{
+ A<42> a;
+ f (a, 24);
+}
deduct4.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+template void foo(T);
+
+template void bar(void (*)(T), T);
+
+void baz() {
+ bar(foo, 1);
+ bar(foo, 1);
+ bar(foo, 1);
+ bar(foo, 1);
+}
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: to2.C
===================================================================
--- to2.C (nonexistent)
+++ to2.C (revision 154)
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+template class B { public: A a; };
+static B b_int;
+static B b_int2;
+
+int foo () { return b_int.a + b_int2.a; }
to2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: t10.C
===================================================================
--- t10.C (nonexistent)
+++ t10.C (revision 154)
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template class B { public: A a; B(); };
+template <> class B { public: int y[10]; };
+static B bi;
+static B bc;
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: memtemp91.C
===================================================================
--- memtemp91.C (nonexistent)
+++ memtemp91.C (revision 154)
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// regression test -
+
+// simplified from bug report by Leon Bottou
+// by Paul Burchard , Level Set Systems, Inc.
+// Copyright (C) 1999 Free Software Foundation
+
+struct A {
+ template
+ struct B {
+ T x;
+ };
+ template
+ struct C : B {
+ C() {}
+ };
+};
+
+
memtemp91.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp74.C
===================================================================
--- memtemp74.C (nonexistent)
+++ memtemp74.C (revision 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+template
+class S
+{
+protected:
+ template
+ void f(U); // { dg-error "" } is protected
+
+private:
+ template
+ void g(U); // { dg-error "" } is private
+};
+
+
+void f()
+{
+ S s;
+ s.f(3); // { dg-error "" } within this context
+ s.g(2.0); // { dg-error "" } within this context
+}
memtemp74.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,10 @@
+// { dg-do run }
+// Bug: g++ silently ignores function-try-blocks in templates.
+// Submitted by Jason Merrill
+
+template void f (T) try { throw 1; } catch (...) { }
+
+int main ()
+{
+ f (1);
+}
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: memtemp2.C
===================================================================
--- memtemp2.C (nonexistent)
+++ memtemp2.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+struct S {
+ template
+ void foo(T&);
+};
+
+
+template
+void S::foo(U&)
+{
+}
+
+
+
memtemp2.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+class foo
+{
+};
+
+template // { dg-error "" } base clause
+struct bar
+{
+};
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: conv2.C
===================================================================
--- conv2.C (nonexistent)
+++ conv2.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+template
+class A {
+public:
+ operator const T*() const;
+ const T* cast() const;
+};
+
+template
+const T* A::cast() const {
+ return operator const T*();
+}
+
+template class A;
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: explicit71.C
===================================================================
--- explicit71.C (nonexistent)
+++ explicit71.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// by Alexandre Oliva
+// Based on a testcase by Reid M. Pinchback
+// According to the C++ Standard [temp.expl.spec]/17-18, explicit
+// specializations are only valid if all enclosing template classes
+// of the specialized template are fully specialized too
+
+template
+class bug {
+ template
+ class a {};
+};
+template
+template <> // { dg-error "" } invalid specialization
+class bug::a {}; // { dg-error "" }
memclass15.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Nov 2000
+
+// Bug 789. We ICE'd trying to instantiate B because there was no
+// existing partial specialization of C in A.
+
+template
+struct A {
+ template
+ struct C { };
+};
+
+template
+struct B {
+ typename A::template C s1;
+};
+
+int main()
+{
+ B b;
+
+ return 0;
+}
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 154)
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell
+
+template
+class S {
+public:
+ template
+ class C {
+ public:
+ void f() { S::i = 3; }
+ };
+
+ template
+ friend class C;
+
+private:
+ static int i;
+};
+
+
+template void S::C::f();
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 154)
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ typedef T S_Type;
+};
+
+
+template
+void foo(typename S::S_Type)
+{
+}
+
+
+template
+void foo(T)
+{
+}
+
+
+struct S2 {};
+
+void bar()
+{
+ foo(S2()); // We can't unify with the first foo, so we get the second.
+}
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: m1.C
===================================================================
--- m1.C (nonexistent)
+++ m1.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+int f1 () {
+ struct A {
+ A() : b (2) { }
+ int fred () { return b.hi_mom; }
+ struct B {
+ int hi_mom;
+ B (int a) { hi_mom = a; }
+ };
+ B b;
+ };
+ A aa;
+ return aa.fred();
+}
+/* crashes with signal 11 */
m1.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+template
+struct S
+{
+ template
+ friend class S;
+
+ void f(T);
+};
+
+template struct S;
+
+void g()
+{
+ S<> s;
+ s.f(3);
+}
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: ttp61.C
===================================================================
--- ttp61.C (nonexistent)
+++ ttp61.C (revision 154)
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Origin: grg at ai dot mit dot edu
+
+class A;
+template class base> class C :
+ public base {
+ public:
+ C(A& newa) : base(newa) {}
+};
ttp61.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ttp44.C
===================================================================
--- ttp44.C (nonexistent)
+++ ttp44.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+template < class T, template < class > class E1, template < class > class E2 >
+class Add {
+public:
+ Add(const E1& e1, const E2& e2) {}
+};
+
+template < class T >
+struct Id {
+ template < template < class > class E >
+ Add < T, ::Id, E > operator+(const E& e) const {
+ return Add < T, ::Id, E >(*this, e);
+ }
+};
+
+template struct Id;
ttp44.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,36 @@
+// { dg-do run }
+template class D
+{
+ public:
+ int f() const;
+};
+
+template int D::f() const
+{
+ return sizeof(T);
+}
+
+template class D,class E> class C
+{
+ D d;
+ public:
+ int f() const { return d.f(); }
+};
+
+template class D,class E> int f(const D &d1)
+{
+ d1.f();
+ C d2;
+ d2.f();
+ return 0;
+}
+
+int main()
+{
+ D c1;
+ D c2;
+ const D c3(c2);
+ f(c1);
+ f(c2);
+ f(c3);
+}
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: defarg8.C
===================================================================
--- defarg8.C (nonexistent)
+++ defarg8.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+// Default arguments containing more than one non-nested explicit
+// template argument leads to parse error
+
+// This might be ill formed. See DR 325 (which would like to make it
+// so)
+
+template class foo1;
+template class foo2; // { dg-error "" }
+
+struct bar {
+ template
+ bar(int i = foo1::baz, // { dg-bogus "" } -
+ int j = int(foo2::baz), // ok
+ int k = foo2::baz) {} // { dg-error "" }
+};
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: memtemp93.C
===================================================================
--- memtemp93.C (nonexistent)
+++ memtemp93.C (revision 154)
@@ -0,0 +1,16 @@
+// { dg-do link }
+// Origin: Mark Mitchell
+
+template struct A {
+ template A (T t);
+ template int f(T t) const;
+};
+
+template <> template int A<1>::f(T t) const {return 1;}
+template <> template A<1>::A (T t) {}
+
+int main() {
+ A<1> a (3);
+ a.f(1);
+ return 0;
+}
memtemp93.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp76.C
===================================================================
--- memtemp76.C (nonexistent)
+++ memtemp76.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+class base
+{
+public:
+ virtual void method()=0;
+};
+
+class der: public base
+{
+public:
+ template
+ void method()
+ {
+ C foo;
+ }
+};
memtemp76.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memtemp59.C
===================================================================
--- memtemp59.C (nonexistent)
+++ memtemp59.C (revision 154)
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+template
+struct IndexPlaceholder {};
+
+template
+struct ArrayIndexMapping {};
+
+template
+struct Array
+{
+ template
+ ArrayIndexMapping
+ f(IndexPlaceholder, IndexPlaceholder);
+};
+
+
+template
+void foo(T_numtype)
+{
+ Array t;
+}
memtemp59.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,67 @@
+// { dg-do assemble }
+
+// Make sure we make the right unqualified class a friend
+// See PR c++/4403
+
+template struct A
+{
+ struct AA;
+ struct AC;
+};
+
+template class B
+ :public A
+{
+ friend struct B::AA; // OK, this has an implicit typename
+ // as if it is 'friend struct typename B::AA'
+ // (I think there's a defect report
+ // about that)
+ friend struct AC; // this makes ::AC a friend *not* A::AC
+
+ private: // only our friends can get out values
+ static T valueA_AA;
+ static T valueA_AC;
+ static T value_AC;
+};
+template T B::valueA_AA;
+template T B::valueA_AC;// { dg-error "" "" } private -
+template T B::value_AC; // { dg-bogus "" "" } -
+
+// this one is a friend
+template struct A::AA
+{
+ int M ()
+ {
+ return B::valueA_AA;
+ }
+};
+
+// this is not a friend
+template struct A::AC
+{
+ T M ()
+ {
+ return B::valueA_AC; // { dg-error "" "" } within this context -
+ }
+};
+
+// this is a friend
+struct AC
+{
+ int M ()
+ {
+ return B::value_AC; // { dg-bogus "" "" } -
+ }
+};
+
+B b;
+A::AA a_aa;
+A::AC a_ac;
+AC ac;
+
+int main ()
+{
+ a_aa.M ();
+ a_ac.M ();
+ ac.M ();
+}
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: ptrmem2.C
===================================================================
--- ptrmem2.C (nonexistent)
+++ ptrmem2.C (revision 154)
@@ -0,0 +1,49 @@
+// { dg-do run }
+struct S;
+
+template
+struct F {
+ S* f (S& s)
+ {
+ return (s.*p)();
+ }
+};
+
+template
+struct D {
+ void d (S& s)
+ {
+ (s.*p) = 3;
+ }
+};
+
+struct S {
+ S* g ();
+ int i;
+ F<&S::g> fg;
+ D<&S::i> di;
+ S* h(), k(F<&S::h>);
+ F<&S::g> fg2;
+ D<&S::i> di2;
+};
+
+S* S::g()
+{
+ return this;
+}
+
+S* S::h()
+{
+ return this;
+}
+
+int main()
+{
+ S s;
+ s.i = 2;
+ s.di.d (s);
+ if (s.i != 3)
+ return 1;
+ if (s.fg2.f(s) != &s)
+ return 1;
+}
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: memtemp4.C
===================================================================
--- memtemp4.C (nonexistent)
+++ memtemp4.C (revision 154)
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// GROUPS passed templates membertemplates
+struct S {
+ template
+ void operator+(T);
+};
+
+
+template
+void S::operator+(T)
+{
+}
memtemp4.C
Property changes :
Added: svn:eol-style
## -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 154)
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+template
+void f(T) {} // { dg-error "" } parameter has incomplete type
+
+class C; // { dg-error "" } forward declaration
+
+void g(const C& c)
+{
+ f(c); // { dg-error "" } invalid use of undefined type
+}
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: explicit73.C
===================================================================
--- explicit73.C (nonexistent)
+++ explicit73.C (revision 154)
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// by Alexandre Oliva
+
+// According to [temp.expl.spec]/2, a template explicit specialization
+// must be declared in the namespace that contains the declaration of
+// the template
+
+namespace N {
+ template class foo; // { dg-error "" } referenced below
+}
+
+using namespace N;
+
+template <> class foo; // { dg-error "" } invalid specialization
explicit73.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit56.C
===================================================================
--- explicit56.C (nonexistent)
+++ explicit56.C (revision 154)
@@ -0,0 +1,17 @@
+// { dg-do run }
+template T* create ();
+
+template T* create2()
+{
+ return create();
+}
+
+template T* create ()
+{
+ return new T;
+}
+
+int main()
+{
+ int *p = create2();
+}
explicit56.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: typename19.C
===================================================================
--- typename19.C (nonexistent)
+++ typename19.C (revision 154)
@@ -0,0 +1,27 @@
+// { dg-do run }
+// { dg-options "" }
+// Origin: Mark Mitchell
+
+template
+struct O {
+ typedef char X;
+};
+
+template
+struct S {
+ typedef double X;
+
+ template
+ struct I : public O {
+ static X x;
+ };
+};
+
+template
+template
+typename S::X S::I::x;
+
+int main()
+{
+ return sizeof (S::I::x) == 1;
+}
typename19.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: explicit39.C
===================================================================
--- explicit39.C (nonexistent)
+++ explicit39.C (revision 154)
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+template
+void f(int i);
+
+void g()
+{
+ f<7>(3); // { dg-error "" } no matching function.
+}
explicit39.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property