Commit 7c69566f by Jason Merrill Committed by Jason Merrill

method.c (defaulted_late_check): Give the defaulted method the same exception…

method.c (defaulted_late_check): Give the defaulted method the same exception specification as the implicit...

	* method.c (defaulted_late_check): Give the defaulted method
	the same exception specification as the implicit declaration.

From-SVN: r160841
parent 33766b66
2010-06-16 Jason Merrill <jason@redhat.com>
* method.c (defaulted_late_check): Give the defaulted method
the same exception specification as the implicit declaration.
2010-06-15 Jason Merrill <jason@redhat.com>
* class.c (add_implicitly_declared_members): Implicit assignment
......
......@@ -1022,6 +1022,15 @@ defaulted_late_check (tree fn)
error_at (DECL_SOURCE_LOCATION (fn),
"does not match expected signature %qD", implicit_fn);
}
/* 8.4.2/2: If it is explicitly defaulted on its first declaration, it is
implicitly considered to have the same exception-specification as if
it had been implicitly declared. */
if (DECL_DEFAULTED_IN_CLASS_P (fn))
{
tree eh_spec = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (implicit_fn));
TREE_TYPE (fn) = build_exception_variant (TREE_TYPE (fn), eh_spec);
}
}
/* Returns true iff FN can be explicitly defaulted, and gives any
......
2010-06-16 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/noexcept01.C: Test defaulted fns.
2010-06-16 Richard Guenther <rguenther@suse.de>
PR c/44555
......
......@@ -59,6 +59,14 @@ struct F
SA (noexcept (F()));
struct G
{
G() = default;
~G() = default;
};
SA (noexcept (G()));
template <class T, bool b>
void tf()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment