diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/explicit71.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/explicit71.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C new file mode 100644 index 000000000..03b879433 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C @@ -0,0 +1,15 @@ +// { dg-do assemble } +// by Alexandre Oliva <oliva@dcc.unicamp.br> +// Based on a testcase by Reid M. Pinchback <reidmp@MIT.EDU> +// 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 X> +class bug { + template <class Y> + class a {}; +}; +template <class X> +template <> // { dg-error "" } invalid specialization +class bug<X>::a<char> {}; // { dg-error "" } |