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....@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.

Reply via email to