re PR c++/55842 (C++11 ICE with boost multi-precision and boost variant)

PR c++/55842
	* semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.

From-SVN: r194869
This commit is contained in:
Jason Merrill 2013-01-03 15:36:14 -05:00 committed by Jason Merrill
parent 8ac16127cf
commit ffabb76185
3 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,8 @@
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.

View File

@ -5454,7 +5454,8 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
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);

View File

@ -0,0 +1,7 @@
// PR c++/55842
// { dg-options -std=c++11 }
template <class=void> struct number {
number() noexcept(noexcept(0)) { }
};
const int z=__has_nothrow_constructor(number<>);