]> granicus.if.org Git - clang/commitdiff
Ignore __aligned__ with zero arguments in addition to __aligned__ with
authorEli Friedman <eli.friedman@gmail.com>
Wed, 30 Jan 2008 17:38:42 +0000 (17:38 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 30 Jan 2008 17:38:42 +0000 (17:38 +0000)
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

Sema/SemaDecl.cpp

index 68177e03c8b8aedc920f4a9ab150575c7439e949..40622d5d3ec4fec234dbba660fc043d672b7db61 100644 (file)
@@ -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)) {