summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-20 20:58:56 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-20 20:58:56 +0000
commit3e51e173b6bbd8f66bbabdf8d153583f2c7c5eae (patch)
treeedbe40ca1b9f1ff68ee8607e38ade2840d88169d /clang/lib/Sema/SemaExpr.cpp
parenta4ca28a3aeb081b2f244e589e9c55b13637b9c75 (diff)
downloadbcm5719-llvm-3e51e173b6bbd8f66bbabdf8d153583f2c7c5eae.tar.gz
bcm5719-llvm-3e51e173b6bbd8f66bbabdf8d153583f2c7c5eae.zip
Reinstate r104117, Chandler Carruth's change that "[provides] a naming
class for UnresolvedLookupExprs, even when occuring on template names" along with a fix for an Objective-C++ crasher it introduced. llvm-svn: 104277
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 320b24227ad..9d8fe9c85f0 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1079,17 +1079,12 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,
// Perform the required lookup.
LookupResult R(*this, Name, NameLoc, LookupOrdinaryName);
if (TemplateArgs) {
- // Just re-use the lookup done by isTemplateName.
- DecomposeTemplateName(R, Id);
-
- // Re-derive the naming class.
- if (SS.isSet()) {
- NestedNameSpecifier *Qualifier
- = static_cast<NestedNameSpecifier *>(SS.getScopeRep());
- if (const Type *Ty = Qualifier->getAsType())
- if (CXXRecordDecl *NamingClass = Ty->getAsCXXRecordDecl())
- R.setNamingClass(NamingClass);
- }
+ // Lookup the template name again to correctly establish the context in
+ // which it was found. This is really unfortunate as we already did the
+ // lookup to determine that it was a template name in the first place. If
+ // this becomes a performance hit, we can work harder to preserve those
+ // results until we get here but it's likely not worth it.
+ LookupTemplateName(R, S, SS, QualType(), /*EnteringContext=*/false);
} else {
bool IvarLookupFollowUp = (!SS.isSet() && II && getCurMethodDecl());
LookupParsedName(R, S, &SS, !IvarLookupFollowUp);
OpenPOWER on IntegriCloud