From 3055528c86920967f163f990599d6b0810a47a97 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 25 Sep 1997 23:13:35 -0400 Subject: [PATCH] add From-SVN: r15718 --- gcc/testsuite/g++.old-deja/g++.pt/explicit1.C | 9 ++++++ .../g++.old-deja/g++.pt/explicit10.C | 9 ++++++ .../g++.old-deja/g++.pt/explicit11.C | 14 +++++++++ .../g++.old-deja/g++.pt/explicit12.C | 17 +++++++++++ .../g++.old-deja/g++.pt/explicit13.C | 21 +++++++++++++ .../g++.old-deja/g++.pt/explicit14.C | 14 +++++++++ .../g++.old-deja/g++.pt/explicit15.C | 30 +++++++++++++++++++ .../g++.old-deja/g++.pt/explicit16.C | 28 +++++++++++++++++ .../g++.old-deja/g++.pt/explicit17.C | 22 ++++++++++++++ .../g++.old-deja/g++.pt/explicit18.C | 11 +++++++ .../g++.old-deja/g++.pt/explicit19.C | 12 ++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit2.C | 9 ++++++ .../g++.old-deja/g++.pt/explicit20.C | 7 +++++ .../g++.old-deja/g++.pt/explicit21.C | 10 +++++++ .../g++.old-deja/g++.pt/explicit22.C | 10 +++++++ .../g++.old-deja/g++.pt/explicit23.C | 12 ++++++++ .../g++.old-deja/g++.pt/explicit24.C | 7 +++++ .../g++.old-deja/g++.pt/explicit25.C | 13 ++++++++ .../g++.old-deja/g++.pt/explicit26.C | 12 ++++++++ .../g++.old-deja/g++.pt/explicit27.C | 12 ++++++++ .../g++.old-deja/g++.pt/explicit28.C | 12 ++++++++ .../g++.old-deja/g++.pt/explicit29.C | 12 ++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit3.C | 9 ++++++ .../g++.old-deja/g++.pt/explicit30.C | 11 +++++++ .../g++.old-deja/g++.pt/explicit31.C | 16 ++++++++++ .../g++.old-deja/g++.pt/explicit32.C | 25 ++++++++++++++++ .../g++.old-deja/g++.pt/explicit33.C | 9 ++++++ .../g++.old-deja/g++.pt/explicit34.C | 10 +++++++ .../g++.old-deja/g++.pt/explicit35.C | 16 ++++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit4.C | 19 ++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit5.C | 19 ++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit6.C | 12 ++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit7.C | 16 ++++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit8.C | 13 ++++++++ gcc/testsuite/g++.old-deja/g++.pt/explicit9.C | 8 +++++ gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C | 10 +++++++ gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C | 23 ++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C | 23 ++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/nontype1.C | 17 +++++++++++ gcc/testsuite/g++.old-deja/g++.pt/syntax1.C | 18 +++++++++++ gcc/testsuite/g++.old-deja/g++.pt/typename1.C | 25 ++++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/warn1.C | 24 +++++++++++++++ 42 files changed, 626 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit10.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit11.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit12.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit13.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit14.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit15.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit16.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit17.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit18.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit19.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit20.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit21.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit22.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit23.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit24.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit25.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit26.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit27.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit28.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit29.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit30.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit31.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit32.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit33.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit34.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit35.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit4.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit5.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit6.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit7.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit8.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/explicit9.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/nontype1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/syntax1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/typename1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/warn1.C diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit1.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit1.C new file mode 100644 index 00000000000..0daf54f2373 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit1.C @@ -0,0 +1,9 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t) {} + +void bar() +{ + &foo; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C new file mode 100644 index 00000000000..d90b8d05197 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C @@ -0,0 +1,9 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t); + +int main() +{ + foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit11.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit11.C new file mode 100644 index 00000000000..fb7834f1a20 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit11.C @@ -0,0 +1,14 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t); + +template +struct S {}; + +int main() +{ + S si; + + foo >(si); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C new file mode 100644 index 00000000000..83ebcc16cc7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C @@ -0,0 +1,17 @@ +// Build don't run: +// GROUPS passed templates +template +struct S +{ + template + void foo(T t); + + template <> + void foo(int) {} +}; + +int main() +{ + S s; + s.template foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C new file mode 100644 index 00000000000..73e0e19e85f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C @@ -0,0 +1,21 @@ +// Build don't run: +// GROUPS passed templates + +template +struct S +{ + template + void foo(T t); + + template <> + void foo(int) { } + + template + void bar(T t) { this->template foo(3.74); } +}; + +int main() +{ + S s; + s.bar(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit14.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit14.C new file mode 100644 index 00000000000..aa9d03fca75 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit14.C @@ -0,0 +1,14 @@ +// Build don't link: +// GROUPS passed templates +template +struct S +{ + template + typename U::R foo(U u); +}; + + +void bar() +{ + S si; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit15.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit15.C new file mode 100644 index 00000000000..290da42192d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit15.C @@ -0,0 +1,30 @@ +// Build don't link: +// GROUPS passed templates +template +class Array; + + +template +class ArraySectionInfo { +public: + enum { rank = 0 }; +}; + + +template +class SliceInfo { +public: + enum { + rank = ArraySectionInfo::rank + }; + + typedef Array T_slice; +}; + +template +typename SliceInfo::T_slice +foo(T2 r2) +{ + return SliceInfo::T_slice(); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit16.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit16.C new file mode 100644 index 00000000000..c7a87339ca1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit16.C @@ -0,0 +1,28 @@ +// Build don't link: +// GROUPS passed templates +template +class Array; + + +template +class ArraySectionInfo { +public: + enum { rank = 0 }; +}; + + +template +class SliceInfo { +public: + static const int rank = ArraySectionInfo::rank; + + typedef Array T_slice; +}; + +template +typename SliceInfo::T_slice +foo(T2 r2) +{ + return SliceInfo::T_slice(); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C new file mode 100644 index 00000000000..8e8688df321 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C @@ -0,0 +1,22 @@ +// Build don't link: +// 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()); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C new file mode 100644 index 00000000000..20c4b75d11e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C @@ -0,0 +1,11 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t) { return 0; } + +int foo(int i); + +int main() +{ + return foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C new file mode 100644 index 00000000000..b209bbe8672 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t); + +template <> +int foo(int i) { return 0; } + +int main() +{ + return foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit2.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit2.C new file mode 100644 index 00000000000..4d88c397f7d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit2.C @@ -0,0 +1,9 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t) {} + +void bar() +{ + (void (*)(int)) &foo; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C new file mode 100644 index 00000000000..487d263ccbc --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C @@ -0,0 +1,7 @@ +// Build don't link: +// GROUPS passed templates +template +T foo(T t); + +template <> +int foo(char c); // ERROR - bad return type. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit21.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit21.C new file mode 100644 index 00000000000..a99a49bae4b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit21.C @@ -0,0 +1,10 @@ +// Build don't link: +// GROUPS passed templates +template +T foo(T* t); + +template <> +int foo(char c); // ERROR - does not match declaration. + +template <> +int bar(); // ERROR - no template bar. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C new file mode 100644 index 00000000000..a0120944548 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C @@ -0,0 +1,10 @@ +// Build don't link: +// GROUPS passed templates +template +T foo(T t, U* u); + +template +T foo(T t, T* t); + +template <> +int foo(int, int*); // ERROR - ambiguous specialization. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C new file mode 100644 index 00000000000..cdffb15bc66 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t) { return 1; } + +template <> +int foo(int i) { return 0; } + +int main() +{ + return foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit24.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit24.C new file mode 100644 index 00000000000..42f4c3cb1a2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit24.C @@ -0,0 +1,7 @@ +// Build don't link: +// GROUPS passed templates +template +int foo(T t); + +int foo(int i) { return 0; } // ERROR - missing template <> + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit25.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit25.C new file mode 100644 index 00000000000..022521695f8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit25.C @@ -0,0 +1,13 @@ +// Build don't link: +// GROUPS passed templates +template +class S {}; + +template +void foo(T t, S); + +void bar() +{ + S<3> s3; + foo<3>("abc", s3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit26.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit26.C new file mode 100644 index 00000000000..eba8d79e292 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit26.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t) { return 1; } + +template <> +int foo(int i) { return 0; } + +int main() +{ + &foo; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit27.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit27.C new file mode 100644 index 00000000000..4a5adb59e70 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit27.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +void foo(T t); + +template <> +void foo(int i) {} + +int main() +{ + &foo; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit28.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit28.C new file mode 100644 index 00000000000..b842b893289 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit28.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t) { return 1; } + +template <> +int foo(int i) { return 0; } + +int main() +{ + return (*&foo)(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit29.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit29.C new file mode 100644 index 00000000000..a247779f8b3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit29.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T) { return 0; } + +int foo(int); + +int main() +{ + return foo(3); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit3.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit3.C new file mode 100644 index 00000000000..2a5309fb4ed --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit3.C @@ -0,0 +1,9 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t, U u) {} + +void bar() +{ + (void (*)(double, int)) &foo; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit30.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit30.C new file mode 100644 index 00000000000..5a697135c46 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit30.C @@ -0,0 +1,11 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T, T*); + + +void bar() +{ + double d; + (*((void (*)(int, double*)) &foo))(3, &d); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C new file mode 100644 index 00000000000..61190f7f5f1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates +template +struct S +{ + template + static double foo(U u) { return (double) u; } +}; + + +int main() +{ + double d = S::template foo(3.3); + + return (d >= 3.1); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit32.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit32.C new file mode 100644 index 00000000000..7c0e28521f0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit32.C @@ -0,0 +1,25 @@ +// Build don't link: +// GROUPS passed templates +template +struct S +{ +}; + + +template <> +struct S +{ + void foo(); +}; + +template <> +void S::foo() +{ +} + + +void bar() +{ + S si; + si.foo(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit33.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit33.C new file mode 100644 index 00000000000..048a3565be8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit33.C @@ -0,0 +1,9 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t); + +template <> +void foo(int) {}; + +void foo(int) {} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C new file mode 100644 index 00000000000..40c1da0aeb9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C @@ -0,0 +1,10 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t); + +template <> +void foo(int) {}; // ERROR - redefinition. + +template <> +void foo(int) {} // ERROR - redefinition. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C new file mode 100644 index 00000000000..9f714427459 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates +struct S +{ + template + void foo(T t); + + template <> + void foo(int i) { } +}; + +int main() +{ + S s; + s.template foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit4.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit4.C new file mode 100644 index 00000000000..911e7b3a20a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit4.C @@ -0,0 +1,19 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t); + +template +struct S {}; + +template +void bar(T t) +{ + void (*f)(S ) = &foo >; +} + + +void baz() +{ + bar(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit5.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit5.C new file mode 100644 index 00000000000..2c2b7637421 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit5.C @@ -0,0 +1,19 @@ +// Build don't link: +// GROUPS passed templates +template +void foo(T t) {} + +template +struct S {}; + +template +void bar(T t) +{ + void (*f)(S ) = &foo >; +} + + +void baz() +{ + bar(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C new file mode 100644 index 00000000000..1ee7751b555 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C @@ -0,0 +1,12 @@ +// Build don't run: +// GROUPS passed templates +template +int foo(T t); + +template <> +int foo(int i) { return 0; } + +int main() +{ + return foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C new file mode 100644 index 00000000000..9f714427459 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates +struct S +{ + template + void foo(T t); + + template <> + void foo(int i) { } +}; + +int main() +{ + S s; + s.template foo(3.0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit8.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit8.C new file mode 100644 index 00000000000..777c5d4afc2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit8.C @@ -0,0 +1,13 @@ +// Build don't link: +// 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); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit9.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit9.C new file mode 100644 index 00000000000..908374b720a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit9.C @@ -0,0 +1,8 @@ +// Build don't link: +// GROUPS passed templates +void foo(int); + +void bar() +{ + foo(3); // ERROR - foo is not a template. +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C new file mode 100644 index 00000000000..99e4f7299eb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C @@ -0,0 +1,10 @@ +// Build don't link: +// GROUPS passed membertemplates +template +class S +{ + S(const S& x) {} + + template + S(const S& x) {} +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C new file mode 100644 index 00000000000..d67da394c3e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C @@ -0,0 +1,23 @@ +// Build don't run: +// GROUPS passed membertemplates +struct S +{ + template + void foo(T t); + + template <> + void foo(int i); +}; + + +template <> +void S::foo(int i) +{ +} + + +int main() +{ + S s; + s.foo(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C new file mode 100644 index 00000000000..2efd4d6d73c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C @@ -0,0 +1,23 @@ +// Build don't run: +// GROUPS passed membertemplates +struct S +{ + template + void foo(T t); + + template <> + void foo(int i); +}; + + +template <> +void S::foo(int i) +{ +} + + +int main() +{ + S s; + s.foo(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/nontype1.C b/gcc/testsuite/g++.old-deja/g++.pt/nontype1.C new file mode 100644 index 00000000000..588f8e62c20 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/nontype1.C @@ -0,0 +1,17 @@ +template +struct B +{ + B(); + ~B(); +}; +template +struct D +{ + D(int r0); + D(B &, int); +}; +template +void func() +{ + D tmp; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C b/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C new file mode 100644 index 00000000000..7126200a5c5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C @@ -0,0 +1,18 @@ +struct X { + enum { + a = 0, + n = 0 + }; +}; + +template +struct Y { + + enum { + a = T1::a + T2::a, + + n = meta_max::max // Crash here. + }; +}; + +int z = Y::a; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename1.C b/gcc/testsuite/g++.old-deja/g++.pt/typename1.C new file mode 100644 index 00000000000..38fd79e8407 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/typename1.C @@ -0,0 +1,25 @@ +template +struct A { + typedef T T1; +}; + +template +struct B { + typedef T T2; +}; + +template +struct C { +}; + +template +C +foo (E) +{ + return C(); +} + +void test() +{ + foo(B >()); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/warn1.C b/gcc/testsuite/g++.old-deja/g++.pt/warn1.C new file mode 100644 index 00000000000..2b9fc7a0398 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/warn1.C @@ -0,0 +1,24 @@ + template + struct S + { + struct R + { + R(); + ~R(); + }; + + void foo() + { + R r; + int i; + } + + S(); + ~S(); + }; + + void f() + { + S si; + si.foo(); + } -- 2.30.2