AST: Don't ignore alignas on EnumDecls when calculating alignment
We didn't consider any alignment attributes on an EnumDecl when calculating alignment. While we are here, ignore alignment specifications on typedef types if one is used as the underlying type. Otherwise, weird things happen: enum Y : int; Y y; typedef int __attribute__((aligned(64))) u; enum Y : u {}; What is the alignment of 'Y'? It would be more consistent with the overall design of enums with fixed underlying types to consider the underlying type's UnqualifiedDesugaredType. This fixes PR22279. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226653 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/AST/ASTContext.cpp 12 additions, 2 deletionslib/AST/ASTContext.cpp
- lib/Sema/SemaDeclAttr.cpp 11 additions, 8 deletionslib/Sema/SemaDeclAttr.cpp
- test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp 6 additions, 0 deletionstest/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
- test/Sema/align-x86.c 2 additions, 0 deletionstest/Sema/align-x86.c
Loading
Please register or sign in to comment