From: Eli Friedman Date: Wed, 30 Jan 2008 17:38:42 +0000 (+0000) Subject: Ignore __aligned__ with zero arguments in addition to __aligned__ with X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ca0867dbee03b353c9c3d1583d183e6316c32f5;p=clang Ignore __aligned__ with zero arguments in addition to __aligned__ with one argument. Lets stuff using pthread.h compile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46559 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 68177e03c8..40622d5d3e 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1863,13 +1863,16 @@ QualType Sema::HandleVectorTypeAttribute(QualType curType, void Sema::HandleAlignedAttribute(Decl *d, AttributeList *rawAttr) { // check the attribute arguments. - // FIXME: Handle the case where are no arguments. - if (rawAttr->getNumArgs() != 1) { + if (rawAttr->getNumArgs() > 1) { Diag(rawAttr->getAttributeLoc(), diag::err_attribute_wrong_number_arguments, std::string("1")); return; } - + + // We probably need to actually do something with this at some point... + if (rawAttr->getNumArgs() == 0) + return; + Expr *alignmentExpr = static_cast(rawAttr->getArg(0)); llvm::APSInt alignment(32); if (!alignmentExpr->isIntegerConstantExpr(alignment, Context)) {