https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

struct VectorType {
  void operator=(VectorType);
};
template <typename> using V4 = VectorType;
using Float = V4<float>;
struct vec3 {
  Float x;
};
struct mat3 {
  vec3 data[3];
  constexpr mat3() { data[2] = vec3(); }
};

$ g++ ff.ii -c
ff.ii: In constructor ‘constexpr mat3::mat3()’:
ff.ii:11:37: error: call to non-‘constexpr’ function ‘vec3&
vec3::operator=(vec3&&)’
   11 |   constexpr mat3() { data[2] = vec3(); }
      |                                     ^
ff.ii:6:8: note: ‘vec3& vec3::operator=(vec3&&)’ is not usable as a ‘constexpr’
function because:
    6 | struct vec3 {
      |        ^~~~
ff.ii:2:8: note: defaulted constructor calls non-‘constexpr’ ‘void
VectorType::operator=(VectorType)’
    2 |   void operator=(VectorType);
      |        ^~~~~~~~
ff.ii:2:8: note: ‘void VectorType::operator=(VectorType)’ declared here

Reply via email to