-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
constexpr int constexpr_var = 101;
[[gnu::constructor(constexpr_var)]] void a() {}
template <int TemplateArg>
[[gnu::constructor(TemplateArg)]] void b() {}
template void b<101>();
This code compiles fine with gcc, and clang can successfully compile a
but errors on b
with "'constructor' attribute requires an integer constant".
Note clang doesn't error on the instantiation of b but rather on the template definition. so even if the template void b<101>();
line is removed clang still gives an error.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute