http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50298

             Bug #: 50298
           Summary: [C++0x][constexpr] References cannot be bound to
                    static constexpr reference members
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: gintensub...@gmail.com


int global_variable;

struct X {
  static constexpr int& r = global_variable;  // error: the value of
'global_variable' is not usable in a constant expression
};


this code should be accepted in C++0x mode, but gcc-4.7-20110903 rejects it.

see also:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49172

Reply via email to