This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50298] New: [C++0x][constexpr] References cannot be bound to static constexpr reference members
- From: "gintensubaru at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Sep 2011 17:58:05 +0000
- Subject: [Bug c++/50298] New: [C++0x][constexpr] References cannot be bound to static constexpr reference members
- Auto-submitted: auto-generated
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