This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61993] New: constexpr static member function "is not constant"
- From: "q dot gcc at rsn-tech dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Aug 2014 22:14:35 +0000
- Subject: [Bug c++/61993] New: constexpr static member function "is not constant"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61993
Bug ID: 61993
Summary: constexpr static member function "is not constant"
Product: gcc
Version: 4.8.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: q.gcc@rsn-tech.co.uk
This works:
static constexpr int idem (int x) { return x; }
struct test
{
static constexpr int a = idem (0);
};
This doesn't:
struct test
{
static constexpr int idem (int x) { return x; }
static constexpr int a = idem (0);
};
The error in the latter case is,
test.cpp:5:39: error: field initializer is not constant
static constexpr int a = idem (0);
^
I don't think this is a duplicate of any of the similar bugs posted; it seems
simpler and not dependent on any context that might not be fully available at
point of compilation.