[Bug c++/67625] New: some constexpr expressions rejected as enumerator value
matthijsvanduin at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 18 13:39:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67625
Bug ID: 67625
Summary: some constexpr expressions rejected as enumerator
value
Product: gcc
Version: 5.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: matthijsvanduin at gmail dot com
Target Milestone: ---
GCC 5.2.1 rejects the following code (with -std=gnu++11 or later):
constexpr uint16_t bswap16( uint16_t x ) {
return __builtin_bswap16( x );
}
constexpr int foo_1 = bswap16(1);
enum { foo_2 = foo_1 };
enum { foo_3 = __builtin_bswap16(1) };
enum { foo_4 = bswap16(1) };
with the error message "enumerator value for ‘foo_4’ is not an integer
constant", while the other three definitions of the same constant are accepted.
This is a regression w.r.t. 4.9.3
More information about the Gcc-bugs
mailing list