aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C
new file mode 100644
index 0000000..32a023b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C
@@ -0,0 +1,17 @@
+// PR c++/47200
+// { dg-do compile { target c++11 } }
+// { dg-options "-w" }
+
+template < int > struct duration
+{
+ constexpr int count ();
+ static constexpr duration min ();
+};
+
+constexpr int
+f (duration < 0 > d, duration < 0 > )
+{
+ return d.count ();
+}
+
+static_assert (f (duration < 0 >::min (), duration < 0 > ()), ""); // { dg-error "non-constant|before its definition" }