[Clang] Accepts invalid `constexpr` in explicit instantiation of variable template
In the following code, the constexpr specifier should not be allowed in the explicit instantiation. It is rejected by GCC, but accepted by Clang.
template <class>
inline constexpr int i{};
template constexpr int i<int>;
See Compiler Explorer: https://godbolt.org/z/jzvY3Mqxc
@llvm/issue-subscribers-clang-frontend
Author: None (MagentaTreehouse)
template constexpr int i<int>;
See Compiler Explorer: https://godbolt.org/z/jzvY3Mqxc
</details>
Interesting edg rejects and MSVC accepts: https://godbolt.org/z/1zWdYzPTv
Using const instead only edg rejects; https://godbolt.org/z/nqM8n8hfK
gcc looks correct based on [temp.explicit]p3: https://eel.is/c++draft/temp.explicit#3:
An explicit instantiation shall not use a storage-class-specifier ([dcl.stc]) other than thread_local. An explicit instantiation of a function template, member function of a class template, or variable template shall not use the inline, constexpr, or consteval specifiers. No attribute-specifier-seq ([dcl.attr.grammar]) shall appertain to an explicit instantiation.