===================================================================
@@ -0,0 +1,21 @@
+// PR c++/50837
+// { dg-options "-std=c++0x" }
+
+template<class T>
+struct z
+{
+ static constexpr bool test_constexpr()
+ {
+ return true;
+ }
+
+ static void test()
+ {
+ static_assert(test_constexpr(), "test1");
+ }
+};
+
+int main()
+{
+ z<int>::test();
+}
===================================================================
@@ -11,7 +11,7 @@ struct Dummy
template<bool B>
void tester()
{
- bar<evil>()(); // { dg-error "constant" }
+ bar<evil>()(); // { dg-error "constant|template" }
}
template<bool B>
struct bar
===================================================================
@@ -13233,7 +13233,7 @@ tsubst_copy_and_build (tree t,
decl = finish_id_expression (t, decl, NULL_TREE,
&idk,
integral_constant_expression_p,
- /*allow_non_integral_constant_expression_p=*/false,
+ /*allow_non_integral_constant_expression_p=*/(cxx_dialect >= cxx0x),
&non_integral_constant_expression_p,
/*template_p=*/false,
/*done=*/true,