diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/constant2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/constant2.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/constant2.C b/gcc/testsuite/g++.dg/template/constant2.C new file mode 100644 index 000000000..f71e4f56a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/constant2.C @@ -0,0 +1,22 @@ +// PR c++/49896 + +template<class C> +class test { + protected: + static const int versionConst = 0x80000000; + enum { versionEnum = versionConst }; + public: + int getVersion(); +}; + +template<class C> +int test<C>::getVersion() { + return versionEnum; +} + +class dummy_class {}; + +int main() { + test<dummy_class> t; + return t.getVersion(); +} |