[PATCH] D71619: [CLANG] Alignment specifier not applied to anonymous structure or union
kamlesh kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 18 19:43:45 PST 2019
kamleshbhalui updated this revision to Diff 234652.
kamleshbhalui added a comment.
added assert.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71619/new/
https://reviews.llvm.org/D71619
Files:
clang/lib/Sema/SemaDecl.cpp
clang/test/AST/pr43983.cpp
Index: clang/test/AST/pr43983.cpp
===================================================================
--- /dev/null
+++ clang/test/AST/pr43983.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -ast-dump | FileCheck %s
+
+struct B { _Alignas(64) struct { int b; }; };
+
+// CHECK: AlignedAttr {{.*}} _Alignas
+// CHECK: ConstantExpr {{.*}} 64
+// CHECK: IntegerLiteral {{.*}} 64
Index: clang/lib/Sema/SemaDecl.cpp
===================================================================
--- clang/lib/Sema/SemaDecl.cpp
+++ clang/lib/Sema/SemaDecl.cpp
@@ -5020,6 +5020,8 @@
/*BitWidth=*/nullptr, /*Mutable=*/false,
/*InitStyle=*/ICIS_NoInit);
Anon->setAccess(AS);
+ ProcessDeclAttributes(S, Anon, Dc);
+
if (getLangOpts().CPlusPlus)
FieldCollector->Add(cast<FieldDecl>(Anon));
} else {
@@ -5033,6 +5035,7 @@
SC = SC_None;
}
+ assert(DS.getAttributes().empty() && "No attribute expected");
Anon = VarDecl::Create(Context, Owner, DS.getBeginLoc(),
Record->getLocation(), /*IdentifierInfo=*/nullptr,
Context.getTypeDeclType(Record), TInfo, SC);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71619.234652.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191219/0dd22eda/attachment.bin>
More information about the cfe-commits
mailing list