We are parsing both C++11 and GNU-style attributes here, but the previous ProhibitAttributes() call was never working for GNU-style attributes.
GNU-style attributes are however expected to be parsed and not diagnosed, for example in clang/test/Sema/ast-print in the following code:
// CHECK-LABEL: enum __attribute__((deprecated(""))) EnumWithAttributes2 *EnumWithAttributes2Ptr; // expected-warning@+2 {{'EnumWithAttributes2' is deprecated}} // expected-note@+1 {{'EnumWithAttributes2' has been explicitly marked deprecated here}} enum __attribute__((deprecated)) EnumWithAttributes2 *EnumWithAttributes2Ptr;
This is essentially the same as https://reviews.llvm.org/D99278 and needs https://reviews.llvm.org/D97362 to be applied first.
The comment just above this change is a bit confusing since it tries to explain that "an elaborated-type-specifier has a much more constrained grammar", but does not mention any attributes.
clang-tidy: error: too many arguments to function call, expected 2, have 3 [clang-diagnostic-error]
not useful