* Richard Guenther:

>>>> +  if (!flag_new_overflow_check)
>>>> +    return result;
>>>
>>> Let's check for constant results here.  If we have a TREE_CONSTANT
>>> result that overflows, we can handle it even if we aren't emitting the
>>> checks for non-constant values.
>>
>> I assume I can report an error in this case?
>
> Only a warning.  The code is only undefined at runtime.  But you
> could convert the allocation to __builtin_trap () (hmm, what
> about exceptions? Is such an allocation required to throw?)

With a std::nothrow specifier, I don't think it is.

But without that, it's required to throw std::bad_array_new_length in
C++0X.  C++03 is ambiguous.

Reply via email to