diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2000-06-02 20:02:48 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-06-02 20:02:48 -0400 |
commit | b9d969b7d40904b673662ffb656b90e184655456 (patch) | |
tree | 4ba24aaa5c1ca5c83dabdb18917c0363506dfa88 | |
parent | c9b39473f3a4c179487e08f766b9bf06192e9fc6 (diff) | |
download | gcc-b9d969b7d40904b673662ffb656b90e184655456.zip gcc-b9d969b7d40904b673662ffb656b90e184655456.tar.gz gcc-b9d969b7d40904b673662ffb656b90e184655456.tar.bz2 |
new
From-SVN: r34366
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C | 23 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C | 17 |
3 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C new file mode 100644 index 0000000..43cc9f6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C @@ -0,0 +1,23 @@ +// Test that 'extern template' suppresses instantiations. +// Special g++ Options: -g -O + +// Ignore the 'ld returned 1' message from collect2. +// excess errors test - XFAIL *-*-* + +template <class T> void f (T) { } +extern template void f (int); + +template <class T> struct A { + void f () { } +}; +extern template struct A<int>; + +int main () +{ + f (42); // ERROR - not instantiated + A<int> a; + a.f (); // ERROR - not instantiated + f (2.0); // gets bogus error + A<double> b; + b.f (); // gets bogus error +} diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C new file mode 100644 index 0000000..05c3e20 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C @@ -0,0 +1,17 @@ +// Test that 'static template' instantiates statics. +// Special g++ Options: -g -fno-implicit-templates + +// Ignore the 'ld returned 1' message from collect2. +// excess errors test - XFAIL *-*-* + +template <class T> struct A { + static T t; +}; +template <class T> T A<T>::t = 0; +static template struct A<int>; + +int main () +{ + A<int>::t = 42; // gets bogus error + A<char>::t = 42; // ERROR - not instantiated +} diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C new file mode 100644 index 0000000..7d710c4 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C @@ -0,0 +1,17 @@ +// Test that 'inline template' instantiates the vtable. +// Special g++ Options: -g -O -fno-implicit-templates + +// Ignore the 'ld returned 1' message from collect2. +// excess errors test - XFAIL *-*-* + +template <class T> struct A { + virtual void f () { } +}; +inline template struct A<int>; + +A<int> a; // gets bogus error +A<char> b; // ERROR - not instantiated + +int main () +{ +} |