[Clang] No diagnostic for attribute in front of extern declarations · Issue #79893 · llvm/llvm-project (original) (raw)
Clang currently accepts
template struct Test {};
[[deprecated]] extern template struct Test;
but doesn't diagnose the use of Test<int>
. I've also tried other attributes and Clang seems to accepts everyhing, even attributes like [[fallthrough]]
. I'm pretty sure it's actually invalid code that Clang accepts silently. GCC and MSVC reject the code with not super great diagnostics.