[cfe-commits] r83119 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/SemaCXX/new-delete.cpp
Douglas Gregor
dgregor at apple.com
Tue Sep 29 17:03:47 PDT 2009
Author: dgregor
Date: Tue Sep 29 19:03:47 2009
New Revision: 83119
URL: http://llvm.org/viewvc/llvm-project?rev=83119&view=rev
Log:
Find operators new/delete in base classes. FIXME -= 2;
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/test/SemaCXX/new-delete.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=83119&r1=83118&r2=83119&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Sep 29 19:03:47 2009
@@ -589,10 +589,8 @@
DeclarationName Name, Expr** Args,
unsigned NumArgs, DeclContext *Ctx,
bool AllowMissing, FunctionDecl *&Operator) {
- // FIXME: Change to use LookupQualifiedName!
- DeclContext::lookup_iterator Alloc, AllocEnd;
- llvm::tie(Alloc, AllocEnd) = Ctx->lookup(Name);
- if (Alloc == AllocEnd) {
+ LookupResult R = LookupQualifiedName(Ctx, Name, LookupOrdinaryName);
+ if (!R) {
if (AllowMissing)
return false;
return Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
@@ -600,7 +598,8 @@
}
OverloadCandidateSet Candidates;
- for (; Alloc != AllocEnd; ++Alloc) {
+ for (LookupResult::iterator Alloc = R.begin(), AllocEnd = R.end();
+ Alloc != AllocEnd; ++Alloc) {
// Even member operator new/delete are implicitly treated as
// static, so don't use AddMemberCandidate.
if (FunctionDecl *Fn = dyn_cast<FunctionDecl>(*Alloc)) {
Modified: cfe/trunk/test/SemaCXX/new-delete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/new-delete.cpp?rev=83119&r1=83118&r2=83119&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/new-delete.cpp (original)
+++ cfe/trunk/test/SemaCXX/new-delete.cpp Tue Sep 29 19:03:47 2009
@@ -38,8 +38,7 @@
ia4 *pai = new (int[3][4]);
pi = ::new int;
U *pu = new (ps) U;
- // FIXME: Inherited functions are not looked up currently.
- //V *pv = new (ps) V;
+ V *pv = new (ps) V;
pi = new (S(1.0f, 2)) int;
@@ -133,7 +132,7 @@
delete x;
}
-class X6 {
+class X5 {
public:
void Destroy() const { delete this; }
};
More information about the cfe-commits
mailing list