[PATCH] D91630: [Parse] Add parsing support for C++ attributes on using-declarations

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 12:34:48 PST 2020


rsmith added a comment.

Do `[[deprecated]]` and `[[maybe_unused]]` now work for //using-declarator//s? If so, a test for that would be useful.



================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:714
 
-  // C++11 attributes are not allowed on a using-declaration, but GNU ones
-  // are.
   ProhibitAttributes(MisplacedAttrs);
+  DiagnoseCXX11AttributeExtension(PrefixAttrs);
----------------
Should we suggest moving the attributes after the identifier in this case (even though that will leave the program ill-formed), as we do for alias-declarations?


================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:737
+    DiagnoseCXX11AttributeExtension(Attrs);
+    Attrs.addAll(PrefixAttrs.begin(), PrefixAttrs.end());
 
----------------
Should the prefix attributes go before the suffix attributes? (I could imagine there might be attributes for which order matters.) What do we do in the simple-declaration case?


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

https://reviews.llvm.org/D91630



More information about the cfe-commits mailing list