This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66656] static constexpr array member: cannot get size via constexpr function
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Jun 2015 20:24:26 +0000
- Subject: [Bug c++/66656] static constexpr array member: cannot get size via constexpr function
- Auto-submitted: auto-generated
- References: <bug-66656-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66656
Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> ---
The compiler/linker is right: You still need to provide a definition for the
second static data member. Providing an initializer does not provide such a
definition. To fix your problem, just add the line
constexpr X::item X::arr1[];
to your code.
This is not a defect.