[PATCH] D88333: Better diagnostics for anonymous bit-fields with attributes or an initializer

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 27 09:20:11 PDT 2020


aaron.ballman updated this revision to Diff 294554.
aaron.ballman retitled this revision from "Correctly parse attributes on the declaration of an anonymous bit-field" to "Better diagnostics for anonymous bit-fields with attributes or an initializer".
aaron.ballman added a comment.
Herald added a reviewer: jdoerfert.

I've updated the patch to continue to reject attributes on anonymous bit-fields, but with a better diagnostic. In addition, I changed how we handle anonymous bit-fields with an initializer (based on discussion on the Core reflector) -- instead of rejecting the construct as a semantic issue, I reject it at the parser level with a similar diagnostic (I went with "in-class initializer" because that's used by other parser diagnostics, but I'm fine with either formulation).


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

https://reviews.llvm.org/D88333

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/test/CXX/class/class.bit/p1.cpp
  clang/test/Parser/MicrosoftExtensions.cpp
  clang/test/Parser/c2x-attributes.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88333.294554.patch
Type: text/x-patch
Size: 7237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200927/60c6f0f3/attachment-0001.bin>


More information about the cfe-commits mailing list