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

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 2 07:30:21 PST 2021


tbaeder added inline comments.


================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1828-1830
+      // Allow only GNU attributes here.
+      if (!attrs.hasOnlyGNUAttributes())
+        ProhibitAttributes(attrs);
----------------
aaron.ballman wrote:
> We really should be using `ProhibitCXX11Attributes()` here, but that doesn't currently handle the case where it's an empty attribute list. However, we could use the valid source range information in that case to look at the tokens used to decide whether to diagnose or not.
Unfortunately, also diagnosing empty `[[]]` triggers a whole lot of the tests, e.g. because `int [[]] foo;` now starts warning.


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

https://reviews.llvm.org/D97362



More information about the cfe-commits mailing list