[PATCH] D126061: [clang] Reject non-declaration C++11 attributes on declarations

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 22:54:40 PDT 2022


mboehme marked 2 inline comments as done.
mboehme added a comment.

Thank you @aaron.ballman and @rsmith for the careful and productive reviews!



================
Comment at: clang/lib/Parse/ParseStmt.cpp:229
   default: {
+    bool HaveAttrs = !(CXX11Attrs.empty() && GNUAttrs.empty());
+    auto IsStmtAttr = [](ParsedAttr &Attr) { return Attr.isStmtAttr(); };
----------------
aaron.ballman wrote:
> I don't insist, but I think it's a tiny bit easier to read this way.
Done!


================
Comment at: clang/lib/Parse/ParseStmt.cpp:321-323
+    for (const ParsedAttr &AL : CXX11Attrs) {
+      Diag(AL.getRange().getBegin(), diag::warn_attribute_ignored) << AL;
+    }
----------------
aaron.ballman wrote:
> 
Done!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126061



More information about the cfe-commits mailing list