[cfe-commits] r62882 - in /cfe/trunk: include/clang/AST/DeclBase.h lib/Sema/SemaExpr.cpp
Douglas Gregor
dgregor at apple.com
Fri Jan 23 13:30:56 PST 2009
Author: dgregor
Date: Fri Jan 23 15:30:56 2009
New Revision: 62882
URL: http://llvm.org/viewvc/llvm-project?rev=62882&view=rev
Log:
Make sure that all NamedDecls have an identifier namespace.
Make sure that we know a call is invalid if we dropped arguments.
Modified:
cfe/trunk/include/clang/AST/DeclBase.h
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=62882&r1=62881&r2=62882&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Fri Jan 23 15:30:56 2009
@@ -257,19 +257,24 @@
if (DeclKind >= FunctionFirst && DeclKind <= FunctionLast)
return IDNS_Ordinary;
assert(0 && "Unknown decl kind!");
- case ImplicitParam:
+ case OverloadedFunction:
case Typedef:
+ case TemplateTypeParm:
+ case EnumConstant:
case Var:
+ case CXXClassVar:
+ case ImplicitParam:
case ParmVar:
case OriginalParmVar:
- case EnumConstant:
case NonTypeTemplateParm:
+ case ObjCMethod:
+ case ObjCContainer:
+ case ObjCCategory:
+ case ObjCProtocol:
case ObjCInterface:
+ case ObjCCategoryImpl:
+ case ObjCProperty:
case ObjCCompatibleAlias:
- case OverloadedFunction:
- case CXXMethod:
- case CXXConversion:
- case CXXClassVar:
return IDNS_Ordinary;
case Field:
@@ -279,9 +284,9 @@
case Record:
case CXXRecord:
- case TemplateTypeParm:
case Enum:
return IDNS_Tag;
+
case Namespace:
return IdentifierNamespace(IDNS_Tag | IDNS_Ordinary);
}
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=62882&r1=62881&r2=62882&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Jan 23 15:30:56 2009
@@ -1684,7 +1684,8 @@
// assignment, to the types of the corresponding parameter, ...
unsigned NumArgsInProto = Proto->getNumArgs();
unsigned NumArgsToCheck = NumArgs;
-
+ bool Invalid = false;
+
// If too few arguments are available (and we don't have default
// arguments for the remaining parameters), don't make the call.
if (NumArgs < NumArgsInProto) {
@@ -1707,6 +1708,7 @@
Args[NumArgs-1]->getLocEnd());
// This deletes the extra arguments.
Call->setNumArgs(NumArgsInProto);
+ Invalid = true;
}
NumArgsToCheck = NumArgsInProto;
}
@@ -1746,7 +1748,7 @@
}
}
- return false;
+ return Invalid;
}
/// ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
More information about the cfe-commits
mailing list