This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51080] New: [C++11] constexpr function array size error
- From: "jarrydb at cse dot unsw.edu.au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Nov 2011 13:10:27 +0000
- Subject: [Bug c++/51080] New: [C++11] constexpr function array size error
- Auto-submitted: auto-generated
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)