Commit 55694175 by Jason Merrill Committed by Jason Merrill

re PR c++/60046 (internal compiler error: in nothrow_spec_p, at cp/except.c:1280)

	PR c++/60046
	* pt.c (maybe_instantiate_noexcept): Don't instantiate exception
	spec from template context.

From-SVN: r207917
parent 1c9f5f33
2014-02-19 Jason Merrill <jason@redhat.com>
PR c++/60046
* pt.c (maybe_instantiate_noexcept): Don't instantiate exception
spec from template context.
2014-02-19 Jakub Jelinek <jakub@redhat.com>
PR debug/56563
......
......@@ -19285,6 +19285,10 @@ maybe_instantiate_noexcept (tree fn)
{
tree fntype, spec, noex, clone;
/* Don't instantiate a noexcept-specification from template context. */
if (processing_template_decl)
return;
if (DECL_CLONED_FUNCTION_P (fn))
fn = DECL_CLONED_FUNCTION (fn);
fntype = TREE_TYPE (fn);
......
// PR c++/60046
// { dg-require-effective-target c++11 }
constexpr bool foo () { return noexcept (true); }
template <typename T>
struct V
{
void bar (V &) noexcept (foo ()) {}
};
template <typename T>
struct W : public V <int>
{
void bar (W &x) { V <int>::bar (x); }
};
int
main ()
{
W <int> a, b;
a.bar (b);
}
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