Just like templates, they are excepted from the ODR rule.
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 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; ^