diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-01-30 17:38:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-01-30 17:38:42 +0000 |
commit | 4ca0867dbee03b353c9c3d1583d183e6316c32f5 (patch) | |
tree | 6965e32458ae3fc18a928b68e835e65a483dc9d5 /Sema/SemaDecl.cpp | |
parent | 78a677bbb5fa115fa0995b5783adeeefad67167e (diff) |
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
Diffstat (limited to 'Sema/SemaDecl.cpp')
-rw-r--r-- | Sema/SemaDecl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<Expr *>(rawAttr->getArg(0)); llvm::APSInt alignment(32); if (!alignmentExpr->isIntegerConstantExpr(alignment, Context)) { |