diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash2.C | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash2.C b/gcc/testsuite/g++.dg/template/crash2.C new file mode 100644 index 000000000..47c95ab06 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash2.C @@ -0,0 +1,31 @@ +// { dg-options "" } + +template <class EnumType> +class A +{ +public: + static const EnumType size = max; // { dg-error "" } + int table[size]; // { dg-error "constant" } +}; +template <class EnumType> +const EnumType A<EnumType>::size; + + +namespace N +{ +enum E { max = 5 }; + +struct B +{ + A<E> a; +}; + +} + +int +main() +{ + N::B b; + + return 0; +} |