[PATCH] D88333: Better diagnostics for anonymous bit-fields with attributes or an initializer
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 28 14:24:17 PDT 2020
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Thanks!
================
Comment at: clang/lib/Parse/ParseDecl.cpp:4126
/// struct-declarator: declarator[opt] ':' constant-expression
- if (Tok.isNot(tok::colon)) {
+ if (Tok.isNot(tok::colon) && !isCXX11AttributeSpecifier()) {
// Don't parse FOO:BAR as if it were a typo for FOO::BAR.
----------------
I think this change is redundant now.
================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:2317
+ // current grammar rules as of C++20.
+ if (Tok.isNot(tok::colon) && !isCXX11AttributeSpecifier())
ParseDeclarator(DeclaratorInfo);
----------------
Similarly here, I think the check for an attribute specifier is now redundant.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88333/new/
https://reviews.llvm.org/D88333
More information about the cfe-commits
mailing list