https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127766
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:1498f0547eb1692c39c63ad3e8e22859dc526e3e commit r17-5424-g1498f0547eb1692c39c63ad3e8e22859dc526e3e Author: Jakub Jelinek <[email protected]> Date: Wed Oct 21 09:04:21 2026 +0200 c++: Call check_trait_type for CPTK_STRUCTURED_BINDING_SIZE [PR127766] The following testcase is rejected because we don't even try to complete the type, so if it wasn't instantiated with those arguments before, we reject it. Fixed up calling check_trait_type, with kind 4, for non-class I think cp_decomp_size already does the right thing, for arrays we actually just care about number of elements. On the pt.cc side, fixed by removing the special casing of this exact trait and instead passing complain to all finish_trait_expr calls in TRAIT_EXPR case. 2026-10-21 Jakub Jelinek <[email protected]> PR c++/127766 * semantics.cc (finish_trait_expr) <case CPTK_STRUCTURED_BINDING_SIZE>: Call check_trait_type with kind 4. * pt.cc (tsubst_expr) <case TRAIT_EXPR>: Remove special casing of CPTK_STRUCTURED_BINDING_SIZE. Instead pass complain to finish_trait_expr. * g++.dg/ext/builtin-structured-binding-size2.C: Expect different diagnostics. * g++.dg/ext/builtin-structured-binding-size7.C: New test. Reviewed-by: Jason Merrill <[email protected]>
