summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
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