From: Aaron Ballman Date: Tue, 7 Jul 2015 12:50:30 +0000 (+0000) Subject: Changing a use of alignof() into llvm::alignOf() for MSVC compatibility. This require... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c4f8ceb26928ad9ce7dc1bb0ad26bfc5c5dd079;p=clang Changing a use of alignof() into llvm::alignOf() for MSVC compatibility. This requires changing a static_assert into an assert, too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241577 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index ebe27a98c4..d15cc88c39 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -1266,8 +1266,9 @@ ObjCTypeParamList *ObjCTypeParamList::create( SourceLocation rAngleLoc) { unsigned size = sizeof(ObjCTypeParamList) + sizeof(ObjCTypeParamDecl *) * typeParams.size(); - static_assert(alignof(ObjCTypeParamList) >= alignof(ObjCTypeParamDecl*), - "type parameter list needs greater alignment"); + assert(llvm::alignOf() >= + llvm::alignOf() && + "type parameter list needs greater alignment"); unsigned align = llvm::alignOf(); void *mem = ctx.Allocate(size, align); return new (mem) ObjCTypeParamList(lAngleLoc, typeParams, rAngleLoc);