You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++11 has a new exception type: std::bad_array_new_length. And per the standard, "If the value of that expression is less than zero or such that the size of the allocated object would exceed the implementation-defined limit, no storage is obtained and the new-expression terminates by throwing an exception of a type that would match a handler (15.3) of type std::bad_array_new_length". Our current behavior is likely good enough in most cases, but it isn't strictly compliant.
The text was updated successfully, but these errors were encountered:
test.cpp:2:13: warning: expression result unused [-Wunused-value]
return (0 && ({lbl1:lbl2: 0;})), (long)&&lbl1 - (long)&&lbl2;
~ ^ ~~~~~~~~~~~~~~~~~
test.cpp:1:16: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr long a() {
^
test.cpp:2:36: note: cast that performs the conversions of a reinterpret_cast is not allowed in a
constant expression
return (0 && ({lbl1:lbl2: 0;})), (long)&&lbl1 - (long)&&lbl2;
^
Extended Description
C++11 has a new exception type: std::bad_array_new_length. And per the standard, "If the value of that expression is less than zero or such that the size of the allocated object would exceed the implementation-defined limit, no storage is obtained and the new-expression terminates by throwing an exception of a type that would match a handler (15.3) of type std::bad_array_new_length". Our current behavior is likely good enough in most cases, but it isn't strictly compliant.
The text was updated successfully, but these errors were encountered: