-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
c23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluation
Description
Hi,
thanks for implementing constexpr for clang-19!
The following code
constexpr int category_width = 5;
int const w = 5;
int const* a = &category_width;
compiles, but produces an external symbol for category_width and then multiple defined symbol errors on linkage. So I cannot use constexpr in header files, or I'd have to prefix it with static, which defeats the purpose of constexpr ...
C23 has in 6.2.2 p3
If the declaration of a file scope identifier for:
— an object contains any of the storage-class specifiersstaticorconstexpr;
— or, a function contains the storage-class specifierstatic,
then the identifier has internal linkage.
Thanks
Jens
frederick-vs-ja
Metadata
Metadata
Assignees
Labels
c23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluation