This is an archive of the discontinued LLVM Phabricator instance.

[CLANG] Alignment specifier not applied to anonymous structure or union
ClosedPublic

Authored by kamleshbhalui on Dec 17 2019, 10:05 AM.

Details

Summary

Apply attributes on anonymous records.
This Fixes https://bugs.llvm.org/show_bug.cgi?id=43983.

Diff Detail

Event Timeline

kamleshbhalui created this revision.Dec 17 2019, 10:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2019, 10:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rsmith added inline comments.Dec 18 2019, 1:05 PM
clang/lib/Sema/SemaDecl.cpp
5039

Should we apply the attributes to the variable in this case, or (if they're always syntactically invalid) assert that there aren't any?

added assert.

Seems fine to me. @aaron.ballman, want to take a look?

aaron.ballman accepted this revision.Dec 19 2019, 1:34 PM

LGTM!

clang/test/AST/pr43983.cpp
2

You can drop the -std=c++11 here (we default to > c++11 anyway).

This revision is now accepted and ready to land.Dec 19 2019, 1:34 PM

removed c++11 from the test.
I do not have commit access, Can someone commit this for me?

removed c++11 from the test.
I do not have commit access, Can someone commit this for me?

Thank you for the patch! I've commit on your behalf in 304d1304b7bac190b6c9733eb07be284bfc17030