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

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 02:21:02 PDT 2022


mboehme updated this revision to Diff 428318.
mboehme added a comment.

Simply code by replacing `ExtractDefiniteDeclAttrs()` function with `SlideAttrsToDeclSpec()`. This essentially inverts the logic: Instead of moving those attributes to a second list that should definitely remain on the declaration, we identify the attributes that should "slide" and move them directly to the `DeclSpec`. This obviates the need for an additional `ParsedAttributes` list and hence simplifies the callsites.


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

https://reviews.llvm.org/D124919

Files:
  clang/include/clang/Basic/AttributeCommonInfo.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Parse/RAIIObjectsForParser.h
  clang/include/clang/Sema/ParsedAttr.h
  clang/include/clang/Sema/Sema.h
  clang/lib/Basic/Attributes.cpp
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Parse/ParseStmt.cpp
  clang/lib/Parse/ParseTemplate.cpp
  clang/lib/Parse/Parser.cpp
  clang/lib/Sema/ParsedAttr.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/Sema/annotate-type.c
  clang/test/SemaCXX/address-space-placement.cpp
  clang/test/SemaCXX/annotate-type.cpp
  clang/test/SemaOpenCL/address-spaces.cl
  clang/utils/TableGen/ClangAttrEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124919.428318.patch
Type: text/x-patch
Size: 40599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220510/79b8e681/attachment-0001.bin>


More information about the cfe-commits mailing list