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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 13:29:35 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:9118
+      ProcessDeclAttributeOptions Options;
+      Options.IncludeCXX11Attributes = AL.isCXX11Attribute();
+      ProcessDeclAttribute(*this, nullptr, ASDecl, AL, Options);
----------------
rsmith wrote:
> aaron.ballman wrote:
> > rsmith wrote:
> > > This seems to be equivalent to setting `IncludeCXX11Attributes` to `true`, which seems to be equivalent to not setting it at all.
> > Hmmm, not quite -- `AL.isCXX11Attribute()` may return `false` (like for the GNU spelling of this attribute).
> It might, but we only care about the value of `IncludeCXX11Attributes` when processing a C++11 attribute, so it doesn't matter how this flag is set for a non-C++11 attribute.
Oh, good observation, you're right!


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