[cfe-commits] libc++ and const expr.
Sebastian Redl
sebastian.redl at getdesigned.at
Sat Feb 4 10:16:07 PST 2012
On 04.02.2012, at 19:06, Howard Hinnant wrote:
> On Feb 4, 2012, at 12:52 PM, Howard Hinnant wrote:
>
>> On Feb 4, 2012, at 12:04 PM, Eli Friedman wrote:
>>>
>>> [expr.shift]p2: [...] if E1 has a signed type and non-negative value,
>>> and E1×2E2 is representable in the result type, then that is the
>>> resulting value; otherwise, the behavior is undefined.
>>>
>>> -Eli
>>
>> I see, you're point is that I've walked into undefined territory because I set the sign bit on the long long? Does changing 1LL to 1ULL make the compiler happy?
>
> Another question: Is there a motivation for giving the compile time behavior of these operations a different behavior than they would have at run time?
The runtime behavior is undefined. Do you really want the compile time behavior to be the same?
As a side note, I think the diagnostics here could still be improved.
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120204/5258be90/attachment.html>
More information about the cfe-commits
mailing list