PR c++/80639 - ICE with invalid PMF initialization.

PR c++/80043 - ICE with -fpermissive
	* typeck.c (convert_for_assignment): Recurse when instantiate_type
	returns without an error.

From-SVN: r249329
This commit is contained in:
Jason Merrill 2017-06-16 22:33:43 -04:00 committed by Jason Merrill
parent d4ddf7af75
commit 5e5932dca5
3 changed files with 31 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2017-06-16 Jason Merrill <jason@redhat.com>
PR c++/80639 - ICE with invalid PMF initialization.
PR c++/80043 - ICE with -fpermissive
* typeck.c (convert_for_assignment): Recurse when instantiate_type
returns without an error.
PR c++/80465 - ICE with generic lambda with noexcept-specifier.
* lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
set longer for a generic lambda.

View File

@ -8499,9 +8499,10 @@ convert_for_assignment (tree type, tree rhs,
if (rhstype == unknown_type_node)
{
tree r = instantiate_type (type, rhs, tf_warning_or_error);
/* -fpermissive might allow this. */
/* -fpermissive might allow this; recurse. */
if (!seen_error ())
return r;
return convert_for_assignment (type, r, errtype, fndecl,
parmnum, complain, flags);
}
else if (fndecl)
error ("cannot convert %qT to %qT for argument %qP to %qD",

View File

@ -0,0 +1,23 @@
// PR c++/80639
// { dg-do compile { target c++14 } }
template < typename > struct A;
struct B
{
template < int > void m ();
template < int > struct K { static void n (); };
void p () { K < 0 >::n (); }
};
template <> struct A < B >
{
using T = void (A::*)();
template < int u > static constexpr T h = &B::m < u >; // { dg-error "cannot convert" }
};
template < int v > void B::K < v >::n ()
{
using S = A < B >;
S::h < 0 >;
}