<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 22, 2014 at 3:47 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, Jul 22, 2014 at 6:40 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>

> On Tue, Jul 22, 2014 at 3:39 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>><br>
> wrote:<br>
>><br>
>>  def ext_integer_too_large_for_signed : ExtWarn<<br>
>> -  "integer constant is larger than the largest %0-bit signed integer<br>
>> type">,<br>
>> -  InGroup<DiagGroup<"implicitly-unsigned-literal">>;<br>
>> +  "integer constant evaluates to value %0 that cannot be represented as a<br>
>> "<br>
>> +  "%1-bit signed integer">,<br>
>> InGroup<DiagGroup<"implicitly-unsigned-literal">>;<br>
>><br>
>> This should probably go on to say that we're interpreting the value as<br>
>> unsigned.<br>
>><br>
>> I also think we should have separate diagnostics for the case where we<br>
>> evaluate a constant expression (which should include the 'evaluates to value<br>
>> %0' part) and the case where it's a literal (where we shouldn't). We don't<br>
>> need to repeat things that are literally present in the source code. (Sorry<br>
>> for suggesting the unconditional change here, I hadn't really looked at the<br>
>> use cases other than the one in SemaDeclAttr.cpp)<br>
><br>
><br>
> Actually, more than this, I think the original diagnostic text was better<br>
> than any of the updated wordings in the case of a literal. The bit-width is<br>
> incidental; the point is that the literal doesn't fit in the largest signed<br>
> type.<br>
<br>
</div>What about literals whose suffix defines the type, like 90000000000000000000UL? <br></blockquote></div><br></div><div class="gmail_extra">Such a suffix does not really define the type. L means "no smaller than long", not "exactly long". Arguably the new wording is better for the MS i32/i64 suffixes, though.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">... but the SemaDeclAttr diagnostic and the "integer literal too large" diagnostic are different problems and should have separate diagnostics.</div></div>