[Clang] Missing diagnostics for attributes after namespace name
The location of the attribute is non-standard in this code:
namespace N [[deprecated]] {}
But clang doesn't emit any diagnostics with -Wall -Wextra -Wpedantic.
Compiler Explorer: https://compiler-explorer.com/z/6zcPanj5Y
CC @erichkeane
named-namespace-definition: inline(opt) namespace attribute-specifier-seq(opt) identifier { namespace-body }
The commit 8bd0055 added handling attributes after the namespace identifier.
Should attributes after the namespace be completely disallowed or just trigger a pedantic warning?
The commit 8bd0055 added handling attributes after the namespace identifier.
Should attributes after the namespace be completely disallowed or just trigger a pedantic warning?
The key here is that we should diagnose attributes with the [[...]] spelling after the identifier. I believe this should just be an error (or not parsed), the way we would if we didn't try to parse it at all.