[clang] fix bug that undefined internal is a warning only for -pedantic-errors (PR #98016)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 05:44:36 PDT 2024


https://github.com/AaronBallman commented:

Thank you for working on this! C23 changed the normative wording here somewhat, so I think we should add additional test coverage. Specifically:

Moreover, if an identifier declared with internal linkage is used in an expression
there shall be exactly one external definition for the identifier in the translation unit, unless it is:
— part of the operand of a sizeof operator whose result is an integer constant;
— part of the operand of an alignof operator whose result is an integer constant;
— part of the controlling expression of a generic selection;
— part of the expression in a generic association that is not the result expression of its generic
selection;
— or, part of the operand of any typeof operator whose result is not a variably modified type.

How about adding those bullets as test cases to make sure we don't diagnose them?

https://github.com/llvm/llvm-project/pull/98016


More information about the cfe-commits mailing list