[cfe-commits] r84880 - /cfe/trunk/lib/Sema/SemaOverload.cpp
Douglas Gregor
dgregor at apple.com
Thu Oct 22 11:02:21 PDT 2009
Author: dgregor
Date: Thu Oct 22 13:02:20 2009
New Revision: 84880
URL: http://llvm.org/viewvc/llvm-project?rev=84880&view=rev
Log:
When replacing a template-id expression with a declaration reference expression after overloading completes, make sure to keep the qualifier. Still not ready with that test-case...
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=84880&r1=84879&r2=84880&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Oct 22 13:02:20 2009
@@ -5383,6 +5383,8 @@
ClassType.getTypePtr()));
return E;
}
+ // FIXME: TemplateIdRefExpr referring to a member function template
+ // specialization!
}
Expr *NewExpr = FixOverloadedFunctionReference(UnOp->getSubExpr(), Fn);
UnOp->setSubExpr(NewExpr);
@@ -5399,10 +5401,17 @@
MemExpr->setMemberDecl(Fn);
E->setType(Fn->getType());
} else if (TemplateIdRefExpr *TID = dyn_cast<TemplateIdRefExpr>(E)) {
- // FIXME: Should we create QualifiedDeclRefExprs here too?
// FIXME: We should capture the template arguments here.
- E = new (Context) DeclRefExpr(Fn, Fn->getType(),
- TID->getSourceRange().getBegin());
+ if (NestedNameSpecifier *Qualifier = TID->getQualifier())
+ E = new (Context) QualifiedDeclRefExpr(Fn, Fn->getType(),
+ TID->getTemplateNameLoc(),
+ /*FIXME?*/false, /*FIXME?*/false,
+ TID->getQualifierRange(),
+ Qualifier);
+ else
+ E = new (Context) DeclRefExpr(Fn, Fn->getType(),
+ TID->getTemplateNameLoc());
+
TID->Destroy(Context);
} else {
assert(false && "Invalid reference to overloaded function");
More information about the cfe-commits
mailing list