diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash104.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash104.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash104.C b/gcc/testsuite/g++.dg/template/crash104.C new file mode 100644 index 000000000..097c46982 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash104.C @@ -0,0 +1,26 @@ +// PR c++/46046 + +template <class T> + struct foo +{ + template <class U, class V = void> + struct type + {}; + + template <class V> + struct type< + typename T::template some_type<int>, + V + > + {}; +}; + +template <class T> + class bar +{}; + +int main() +{ + typedef foo<bar<int> > cont; + cont::type<char> obj; // { dg-error "cannot be defined" } +} |