From 07b2cfcdb817cc0790420f159a313d61e7241cb9 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Fri, 2 Apr 2010 08:55:10 +0000 Subject: Update clang to r100181. --- lib/Sema/SemaLookup.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/Sema/SemaLookup.cpp') diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 9ae520d..a29c4d4 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -304,6 +304,23 @@ void LookupResult::configure() { SemaRef.getLangOptions().CPlusPlus, isForRedeclaration()); IsAcceptableFn = getResultFilter(LookupKind); + + // If we're looking for one of the allocation or deallocation + // operators, make sure that the implicitly-declared new and delete + // operators can be found. + if (!isForRedeclaration()) { + switch (Name.getCXXOverloadedOperator()) { + case OO_New: + case OO_Delete: + case OO_Array_New: + case OO_Array_Delete: + SemaRef.DeclareGlobalNewDelete(); + break; + + default: + break; + } + } } // Necessary because CXXBasePaths is not complete in Sema.h @@ -539,13 +556,13 @@ static bool LookupDirect(Sema &S, LookupResult &R, const DeclContext *DC) { // Compute the type of the function that we would expect the conversion // function to have, if it were to match the name given. // FIXME: Calling convention! + FunctionType::ExtInfo ConvProtoInfo = ConvProto->getExtInfo(); QualType ExpectedType = R.getSema().Context.getFunctionType(R.getLookupName().getCXXNameType(), 0, 0, ConvProto->isVariadic(), ConvProto->getTypeQuals(), false, false, 0, 0, - ConvProto->getNoReturnAttr(), - CC_Default); + ConvProtoInfo.withCallingConv(CC_Default)); // Perform template argument deduction against the type that we would // expect the function to have. -- cgit v1.1