Wconstexpr-not-const on conversion operators

Hi all,

There is a behaviour that I think is wrong about the Wconstexpr-not-const I don’t think it should apply to conversion operators.

In my project I have warning as errors and the second operator have an error because it is not const, but actually marking it const will cause an ambiguity.

constexpr operator const Vector3() const
{
// It is the equivalent of Vector3 = Point3 - Origin
return Vector3(x, y, z);
}

constexpr operator Vector3()
{
// It is the equivalent of Vector3 = Point3 - Origin
return Vector3(x, y, z);
}

If I make it const here is the ambiguity:

error: reference initialization of type ‘const Vector3 &’ with initializer of type ‘Math::Point3’ is ambiguous
vertex.position_ = matrix * vertex.position_;
^~~~~~~~~~~~~~~~
note: candidate function
constexpr operator const Vector3() const
^
note: candidate function
constexpr operator Vector3() const

I know I could disable the warning locally but this condemn all people that will stay c++11 and not pass to c++1y.

Thanks for your feedback

Emmanuel