[cfe-commits] r46559 - /cfe/trunk/Sema/SemaDecl.cpp
Eli Friedman
eli.friedman at gmail.com
Wed Jan 30 09:38:43 PST 2008
Author: efriedma
Date: Wed Jan 30 11:38:42 2008
New Revision: 46559
URL: http://llvm.org/viewvc/llvm-project?rev=46559&view=rev
Log:
Ignore __aligned__ with zero arguments in addition to __aligned__ with
one argument. Lets stuff using pthread.h compile.
Modified:
cfe/trunk/Sema/SemaDecl.cpp
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=46559&r1=46558&r2=46559&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Wed Jan 30 11:38:42 2008
@@ -1863,13 +1863,16 @@
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)) {
More information about the cfe-commits
mailing list