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: unassig...@gcc.gnu.org
        ReportedBy: l...@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.

Reply via email to