Commit 559a77e1 by Jason Merrill Committed by Jason Merrill

PR c++/80043 - ICE with -fpermissive

	* typeck.c (convert_for_assignment): Handle instantiate_type
	not giving an error.

From-SVN: r246180
parent 3231d64b
2017-03-15 Jason Merrill <jason@redhat.com>
PR c++/80043 - ICE with -fpermissive
* typeck.c (convert_for_assignment): Handle instantiate_type
not giving an error.
2017-03-14 Nathan Sidwell <nathan@acm.org> 2017-03-14 Nathan Sidwell <nathan@acm.org>
PR c++/79393 DR 1658 workaround PR c++/79393 DR 1658 workaround
......
...@@ -8486,7 +8486,12 @@ convert_for_assignment (tree type, tree rhs, ...@@ -8486,7 +8486,12 @@ convert_for_assignment (tree type, tree rhs,
overloaded function. Call instantiate_type to get error overloaded function. Call instantiate_type to get error
messages. */ messages. */
if (rhstype == unknown_type_node) if (rhstype == unknown_type_node)
instantiate_type (type, rhs, tf_warning_or_error); {
tree r = instantiate_type (type, rhs, tf_warning_or_error);
/* -fpermissive might allow this. */
if (!seen_error ())
return r;
}
else if (fndecl) else if (fndecl)
error ("cannot convert %qT to %qT for argument %qP to %qD", error ("cannot convert %qT to %qT for argument %qP to %qD",
rhstype, type, parmnum, fndecl); rhstype, type, parmnum, fndecl);
......
// PR c++/80043
// { dg-options -fpermissive }
struct A
{
template<int> void foo()
{
void (A::* fp)();
fp = A::foo<0>; // { dg-warning "assuming pointer to member" }
}
};
void bar()
{
A().foo<0>();
}
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