This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 52363

On 04/18/2012 09:00 PM, Jason Merrill wrote:
On 04/18/2012 01:44 PM, Paolo Carlini wrote:
+ cand = tourney (candidates, tf_warning_or_error);

This seems unlikely to do the right thing; we can get here in both SFINAE and non-SFINAE situations. In build_user_type_conversion_1 I think we can get away with checking LOOKUP_COMPLAIN;
... however, I must admit that I'm not sure to understand what exactly we are risking here, in terms of regressions: I mean, *currently*, if build_user_type_conversion_1 is called in a SFINAE situation, it seems indeed in principle possible that the above call leads to hard errors. With my change, tourney keeps on behaving exactly in the same way, that is - if I didn't make some stupid material mistake somewhere:

tourney (candidates) == tourney (candidates, tf_warning_or_error)

Thus, it seems to me that with above change it's just that we don't have any hope of fixing latent SFINAE bugs in turney called by build_user_type_conversion_1 per the above. And, at this time, we don't have any evidence of such bugs.

That said, if we want to pursue the approach you suggested above (instead of going for adding complain to build_user_type_conversion_1, as I did in my second proposal), we could for example add more to LOOKUP_COMPLAIN, eg. adding LOOKUP_NO_CONVERSION is enough for the testsuite:

  cand = tourney (candidates,
          ? tf_warning_or_error : tf_none);

but then, this is something I would personally consider a bit risky, because we could definitely stop producing errors and warnings which we do produce now. Unless we are able to audit all the callers of build_user_type_conversion_1 and make sure we got the latter check right (not so many, just a few in call.c and cvt.c)

What do you think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]