aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
new file mode 100644
index 000000000..78065c306
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
@@ -0,0 +1,21 @@
+// { dg-do compile { target c++11 } }
+
+struct B
+{
+ constexpr operator int() { return 4; }
+};
+
+template <int I>
+struct C;
+
+template<>
+struct C<4> { typedef int TP; };
+
+template <class T>
+struct A
+{
+ constexpr static B t = B();
+ C<t>::TP tp;
+};
+
+A<B> a;