<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span style="background-color: transparent;"><br></span></div><div><span style="background-color: transparent;">Hi all, </span></div><div><span style="background-color: transparent;"><br></span></div><div>There is a behaviour that I think is wrong about the Wconstexpr-not-const I don't think it should apply to conversion operators.</div><div><br></div><div>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. </div><div><span style="background-color: transparent;"><br></span></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      constexpr operator const Vector3<T>() const</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      {</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">         // It is the equivalent of Vector3 = Point3 - Origin</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">         return Vector3<T>(x, y, z);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      }</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><span style="background-color: transparent;"><br></span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      constexpr operator Vector3<T>()</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      {</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">         // It is the equivalent of Vector3 = Point3 - Origin</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">         return Vector3<T>(x, y, z);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">      }</span></div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;"><br></span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;">If I make it const here is the ambiguity:</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="background-color: transparent;"><br></span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">error: reference initialization of type 'const Vector3<float> &' with initializer of type 'Math::Point3<Float32>' is ambiguous</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">               vertex.position_ = matrix * vertex.position_;</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">                                           ^~~~~~~~~~~~~~~~</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">note: candidate function</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">      constexpr operator const Vector3<T>() const</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">                ^</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">note: candidate function</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">      constexpr operator Vector3<T>() const</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><br></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">I know I could disable the warning locally but this condemn all people that will stay c++11 and not pass to c++1y.</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><br></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">Thanks for your feedback</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><br></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; ">Emmanuel</div></div></body></html>