[PATCH] D97362: [clang][parser] Allow attributes in explicit template instantiations

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 31 06:07:02 PDT 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.

LGTM, thank you for the fixes!



================
Comment at: clang/lib/Parse/ParseDecl.cpp:4656-4657
       !getLangOpts().ObjC) {
-    ProhibitAttributes(attrs);
+    ProhibitCXX11Attributes(attrs, diag::err_attributes_not_allowed,
+                            /*DiagnoseEmptyAttrs=*/true);
     if (BaseType.isUsable())
----------------
tbaeder wrote:
> aaron.ballman wrote:
> > Test coverage for this change?
> I did not add tests for these changes since they are NFC and already tested:
>   1) We test that empty `[[]]` are not allowed for example in `clang/test/Parser/cxx0x-attributes.c:192`: `enum [[]] E1 e;`
>   2) We test that GNU-style attributes are still allowed for example in `clang/test/Sema/ast-print.c:94`: `enum __attribute__((deprecated)) EnumWithAttributes2 *EnumWithAttributes2Ptr;`
Ah, thanks, I missed that we had already tested both kinds of attributes instead of just one. (Same below.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97362/new/

https://reviews.llvm.org/D97362



More information about the cfe-commits mailing list