https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118513
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:2fcb0c079530b019586e5693f057d2eb72855e70 commit r15-7085-g2fcb0c079530b019586e5693f057d2eb72855e70 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Sun Jan 19 15:26:03 2025 +1100 c++/modules: Check linkage of structured binding decls When looking at PR c++/118513 I noticed that we don't currently check the linkage of structured binding declarations in modules. This patch adds those checks, and corrects decl_linkage to properly recognise structured binding declarations as potentially having linkage. gcc/cp/ChangeLog: * parser.cc (cp_parser_decomposition_declaration): Check linkage of structured bindings in modules. * tree.cc (decl_linkage): Structured bindings don't necessarily have no linkage. gcc/testsuite/ChangeLog: * g++.dg/modules/export-6.C: Add structured binding tests. * g++.dg/modules/hdr-2.H: Likewise. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>