summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-16 19:28:42 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-16 19:28:42 +0000
commitf15f5d3e9fd9db78697c46f216786ac4bb9cdd5b (patch)
tree978f24d2cf9c36792eb346fe8e98cb1ae9825d68 /clang/lib/Sema/SemaExpr.cpp
parent1598a3a1a919a64f4adb95f114c21a00f55efcb7 (diff)
downloadbcm5719-llvm-f15f5d3e9fd9db78697c46f216786ac4bb9cdd5b.tar.gz
bcm5719-llvm-f15f5d3e9fd9db78697c46f216786ac4bb9cdd5b.zip
When inside an Objective-C++ method, name lookup should look into the
interface for ivars before assuming that this is an unresolved function name. Fixes <rdar://problem/6590445>. llvm-svn: 64653
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 07079dbb7da..553c29e8972 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -565,20 +565,6 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
LookupResult Lookup = LookupParsedName(S, SS, Name, LookupOrdinaryName,
false, true, Loc);
- if (getLangOptions().CPlusPlus && (!SS || !SS->isSet()) &&
- HasTrailingLParen && Lookup.getKind() == LookupResult::NotFound) {
- // We've seen something of the form
- //
- // identifier(
- //
- // and we did not find any entity by the name
- // "identifier". However, this identifier is still subject to
- // argument-dependent lookup, so keep track of the name.
- return Owned(new (Context) UnresolvedFunctionNameExpr(Name,
- Context.OverloadTy,
- Loc));
- }
-
NamedDecl *D = 0;
if (Lookup.isAmbiguous()) {
DiagnoseAmbiguousLookup(Lookup, Name, Loc,
@@ -621,6 +607,21 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
return Owned(new (Context) ObjCSuperExpr(Loc, T));
}
}
+
+ if (getLangOptions().CPlusPlus && (!SS || !SS->isSet()) &&
+ HasTrailingLParen && D == 0) {
+ // We've seen something of the form
+ //
+ // identifier(
+ //
+ // and we did not find any entity by the name
+ // "identifier". However, this identifier is still subject to
+ // argument-dependent lookup, so keep track of the name.
+ return Owned(new (Context) UnresolvedFunctionNameExpr(Name,
+ Context.OverloadTy,
+ Loc));
+ }
+
if (D == 0) {
// Otherwise, this could be an implicitly declared function reference (legal
// in C90, extension in C99).
OpenPOWER on IntegriCloud