Just like templates, they are excepted from the ODR rule.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Gentle ping.
I'm open to suggestions to simplify the condition, but I think templates, partial specializations and instantiations are three different things that we all need to exclude here.
I think the pings have gone on long enough -- if there's an issue with the patch, we can address it post-commit.
I think it's a simple enough fix that it may be worth it, but it isn't fixing a regression in behavior so it's not critical. If it helps you out to move it onto the 10 branch, I think it's fine.
Exactly, it would just be a bug fix.
If it helps you out to move it onto the 10 branch, I think it's fine.
I might be porting this back anyways on downstream, but I don't want to be selfish.
Actually it is a regression, but one that we already had in Clang 9. Try this code:
template <typename T> constexpr bool X = true; template <typename T> constexpr bool X<T*> = false;
Clang 9 emits the following false positive warning, which Clang 8 doesn't emit:
<source>:5:16: warning: no previous extern declaration for non-static variable 'X<T *>' [-Wmissing-variable-declarations] constexpr bool X<T*> = false; ^ <source>:5:11: note: declare 'static' if the variable is not intended to be used outside of this translation unit constexpr bool X<T*> = false; ^
@hans, could you cherry-pick this on the version 10 branch? As I wrote in D68923#1857046, this is a regression from Clang 8.