On 6/22/20 10:09 PM, Marek Polacek wrote:
convert_like issues errors about bad_p conversions at the beginning
of the function, but in the ck_ref_bind case, it only issues them
after we've called convert_like on the next conversion.
This doesn't work as expected since r10-7096 because when we see
a conversion from/to class type in a template, we return early, thereby
missing the error, and a bad_p conversion goes by undetected. That
made the attached test to compile even though it should not.
Hmm, why isn't there an error at instantiation time?
Though giving an error at template parsing time is definitely preferable.
I had thought that I could just move the ck_ref_bind/bad_p errors
above to the rest of them, but that regressed diagnostics because
expr then wasn't converted yet by the nested convert_like_real call.
Yeah, the early section is really just for scalar conversions.
It would probably be good to do normal processing for all other bad
conversions and only afterward build the IMPLICIT_CONV_EXPR if we aren't
returning error_mark_node.
Jason