PR c++/55842
* semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
From-SVN: r194869
2013-01-03 Jason Merrill <jason@redhat.com>
+ PR c++/55842
+ * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
+
PR c++/55856
* semantics.c (build_data_member_initialization): Handle DECL_EXPR.
return (trait_expr_value (CPTK_HAS_TRIVIAL_CONSTRUCTOR, type1, type2)
|| (CLASS_TYPE_P (type1)
&& (t = locate_ctor (type1))
- && TYPE_NOTHROW_P (TREE_TYPE (t))));
+ && (maybe_instantiate_noexcept (t),
+ TYPE_NOTHROW_P (TREE_TYPE (t)))));
case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
type1 = strip_array_types (type1);
--- /dev/null
+// PR c++/55842
+// { dg-options -std=c++11 }
+
+template <class=void> struct number {
+ number() noexcept(noexcept(0)) { }
+};
+const int z=__has_nothrow_constructor(number<>);