This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50298] New: [C++0x][constexpr] References cannot be bound to static constexpr reference members


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: unassigned@gcc.gnu.org
        ReportedBy: gintensubaru@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]