https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120717
Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |ppalka at gcc dot gnu.org Last reconfirmed| |2025-06-20 --- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> --- > 1. Refine the implementation-detail metafunction > std::__is_complete_or_unbounded so that it correctly handles such reference > to incomplete types. Makes sense, the warning demonstrates that __is_complete_or_unbounded needlessly tries to instantiate the underlying type of a reference type (or array of unknown bound). > Option 1 appears to be unimplementable because such metafunction can be > called several times in different contexts, which can result in ODR-violation. I think ODR violation is only a risk if the sizeof check happens inside the template definition. If the sizeof check only happens during template argument deduction (e.g. encoded as a default template argument as it is now), that shouldn't introduce ODR violations since the result of template argument deduction can vary across a program, unlike template instantiation, IIUC.