[Bug c++/55029] New: constexpr bug: lvalue required?
luto at mit dot edu
gcc-bugzilla@gcc.gnu.org
Mon Oct 22 23:18:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55029
Bug #: 55029
Summary: constexpr bug: lvalue required?
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: luto@mit.edu
This code:
-----
template<int x>
class A
{
public:
constexpr A() : val_(0) {}
static constexpr A Func(int units)
{
return A();
}
template<int y> explicit operator A<y>() const;
private:
int val_;
A(double);
};
struct Foo
{
static constexpr A<2> z = A<2>::Func(0);
};
-----
fails on gcc 4.6 with 20:41: error: lvalue required as unary ‘&’ operand
gcc 4.7 and trunk is okay.
More information about the Gcc-bugs
mailing list