diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/crash-3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/crash-3.C | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/crash-3.C b/gcc/testsuite/g++.dg/other/crash-3.C new file mode 100644 index 000000000..d13821dee --- /dev/null +++ b/gcc/testsuite/g++.dg/other/crash-3.C @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-options "-g" } +// Contributed by: <schmid at snake dot iap dot physik dot tu-darmstadt dot de> +// and Niall Douglas <s_gccbugzilla at nedprod dot com> +// PR c++/14246: ice in write_template_arg_literal while mangling boolean +// expressions. + +namespace N1 { + + template <typename T> + struct A { + enum { Yes = (sizeof(T) == 1) }; + }; + + template<bool T> + struct B { + void foo(void); + }; + + template struct B< !A<int>::Yes >; + +} + + +namespace N2 { + + template<bool> struct A {}; + A<!false> a; + +} + |