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

PR c++/56268
	* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
	maybe_instantiate_noexcept.

From-SVN: r195945
This commit is contained in:
Jason Merrill 2013-02-11 11:21:10 -05:00 committed by Jason Merrill
parent 6de2a9bf36
commit 47fc639ae2
3 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-02-11 Jason Merrill <jason@redhat.com>
PR c++/56268
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
maybe_instantiate_noexcept.
2013-02-09 Jason Merrill <jason@redhat.com>
PR c++/56247

View File

@ -5351,6 +5351,7 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p)
else if (copy_fn_p (fn) <= 0)
continue;
maybe_instantiate_noexcept (fn);
if (!TYPE_NOTHROW_P (TREE_TYPE (fn)))
return false;
}

View File

@ -0,0 +1,19 @@
// PR c++/56268
// { dg-options -std=c++11 }
template <class T>
struct A {
A(const A&) noexcept (T::value);
};
struct B {
static const bool value = true;
};
template <class T>
struct C {
static const bool value = __has_nothrow_copy (T);
};
#define SA(X) static_assert((X),#X)
SA(C<A<B>>::value);