[Bug c++/51080] New: [C++11] constexpr function array size error
jarrydb at cse dot unsw.edu.au
gcc-bugzilla@gcc.gnu.org
Thu Nov 10 13:17:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51080
Bug #: 51080
Summary: [C++11] constexpr function array size error
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jarrydb@cse.unsw.edu.au
The program below fails to compile with the following error:
g++ -c constexpr-array.cpp -std=gnu++11
constexpr-array.cpp:4:25: error: size of array ‘data’ is not an integral
constant-expression
class A
{
static constexpr int static_size() { return 16; }
int data[static_size()];
};
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/jarryd/current/soft/install-latest/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/jarryd/current/soft/src/gcc-git/configure
--prefix=/home/jarryd/current/soft/install-latest --disable-multilib
--enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20111109 (experimental) (GCC)
More information about the Gcc-bugs
mailing list