/// as such, doesn't contain the array of TemplateArgumentLoc itself,
/// but expects the containing object to also provide storage for
/// that.
-struct LLVM_ALIGNAS(LLVM_PTR_SIZE) ASTTemplateKWAndArgsInfo {
+struct alignas(void *) ASTTemplateKWAndArgsInfo {
/// \brief The source location of the left angle bracket ('<').
SourceLocation LAngleLoc;
unsigned TypeQuals : 5;
// CXXScopeSpec has a constructor, so it can't be a direct member.
// So we need some pointer-aligned storage and a bit of trickery.
- union {
- void *Aligner;
- char Mem[sizeof(CXXScopeSpec)];
- } ScopeMem;
+ alignas(CXXScopeSpec) char ScopeMem[sizeof(CXXScopeSpec)];
CXXScopeSpec &Scope() {
- return *reinterpret_cast<CXXScopeSpec*>(ScopeMem.Mem);
+ return *reinterpret_cast<CXXScopeSpec *>(ScopeMem);
}
const CXXScopeSpec &Scope() const {
- return *reinterpret_cast<const CXXScopeSpec*>(ScopeMem.Mem);
+ return *reinterpret_cast<const CXXScopeSpec *>(ScopeMem);
}
void destroy() {
Scope().~CXXScopeSpec();
I.EndLoc = Loc;
I.Mem.TypeQuals = TypeQuals;
I.Mem.AttrList = nullptr;
- new (I.Mem.ScopeMem.Mem) CXXScopeSpec(SS);
+ new (I.Mem.ScopeMem) CXXScopeSpec(SS);
return I;
}
void *Data;
/// \brief A diagnostic indicating why deduction failed.
- union {
- void *Align;
- char Diagnostic[sizeof(PartialDiagnosticAt)];
- };
+ alignas(PartialDiagnosticAt) char Diagnostic[sizeof(PartialDiagnosticAt)];
/// \brief Retrieve the diagnostic which caused this deduction failure,
/// if any.