This is the mail archive of the gcc-patches@gcc.gnu.org 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/RFC] Back to PR 53159


Hi,

On 07/10/2014 10:55 PM, Jason Merrill wrote:
Hmm, why aren't we already getting the error from

  if (convs->check_narrowing)
    check_narrowing (totype, expr);

in convert_like_real? Is it that we need to copy LOOKUP_NO_NARROWING into convflags in build_user_type_conversion_1?
Ah, ah, thanks. Frankly I noticed that flag but somehow decided to not focus on it :(

Anyway, certainly build_user_type_conversion_1 can be tweaked as you are suggesting, the only missing bit is that it doesn't get LOOKUP_NO_NARROWING in the flags, and cannot figure it out from expr because it's a TARGET_EXPR at that point. Thus it seems to me we have to pass it down from, say, check_initializer when init is still a CONSTRUCTOR and its BRACE_ENCLOSED_INITIALIZER_P (init) is set? I'm going to test the below... makes sense?

Paolo.

//////////////////

Attachment: p
Description: Text document


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