Patrick pointed out that if the parm/arg types aren't complete yet at this
point, it would affect the type_has_converting_constructor and
TYPE_HAS_CONVERSION tests. I don't have a testcase, but it makes sense for
safety.
PR c++/99599
gcc/cp/ChangeLog:
* pt.cc (conversion_may_instantiate_p): Make sure
classes are complete.
/* Converting to a non-aggregate class type will consider its
user-declared constructors, which might induce instantiation. */
- if (CLASS_TYPE_P (to)
+ if (CLASS_TYPE_P (complete_type (to))
&& type_has_converting_constructor (to))
return true;
/* Similarly, converting from a class type will consider its conversion
functions. */
- if (CLASS_TYPE_P (from)
+ if (CLASS_TYPE_P (complete_type (from))
&& TYPE_HAS_CONVERSION (from))
return true;