diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/instantiate9.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/instantiate9.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/instantiate9.C b/gcc/testsuite/g++.dg/template/instantiate9.C new file mode 100644 index 000000000..33f1d6018 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/instantiate9.C @@ -0,0 +1,15 @@ +/* PR c++/14622. The invalid explicit instantiation was not reported. */ +/* { dg-do compile } */ +template<class T> +class A +{ + static T a; +}; + +template<class T> +T A<T>::a; + +struct B {}; + +template B A<int>::a; /* { dg-error "does not match declared type" } */ +template float A<float>::a; |