summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
new file mode 100644
index 000000000..a34704d83
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
@@ -0,0 +1,21 @@
+// { dg-options -std=c++0x }
+
+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;