forked from OSchip/llvm-project
When name lookup finds a single declaration that was imported via a
using declaration, look at its underlying declaration to determine the lookup result kind (e.g., overloaded, unresolved). Fixes at least one issue in Boost.Bimap. llvm-svn: 102317
This commit is contained in:
parent
1fc01985a3
commit
516d672310
|
@ -2834,6 +2834,7 @@ Sema::BuildMemberReferenceExpr(ExprArg Base, QualType BaseExprType,
|
||||||
|
|
||||||
Diag(MemberDecl->getLocation(), diag::note_member_declared_here)
|
Diag(MemberDecl->getLocation(), diag::note_member_declared_here)
|
||||||
<< MemberName;
|
<< MemberName;
|
||||||
|
R.suppressDiagnostics();
|
||||||
return ExprError();
|
return ExprError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3514,7 +3515,8 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
|
||||||
// declarations (all methods or method templates) or a single
|
// declarations (all methods or method templates) or a single
|
||||||
// method template.
|
// method template.
|
||||||
assert((MemE->getNumDecls() > 1) ||
|
assert((MemE->getNumDecls() > 1) ||
|
||||||
isa<FunctionTemplateDecl>(*MemE->decls_begin()));
|
isa<FunctionTemplateDecl>(
|
||||||
|
(*MemE->decls_begin())->getUnderlyingDecl()));
|
||||||
(void)MemE;
|
(void)MemE;
|
||||||
|
|
||||||
return BuildCallToMemberFunction(S, Fn, LParenLoc, Args, NumArgs,
|
return BuildCallToMemberFunction(S, Fn, LParenLoc, Args, NumArgs,
|
||||||
|
|
|
@ -299,9 +299,10 @@ void LookupResult::resolveKind() {
|
||||||
// If there's a single decl, we need to examine it to decide what
|
// If there's a single decl, we need to examine it to decide what
|
||||||
// kind of lookup this is.
|
// kind of lookup this is.
|
||||||
if (N == 1) {
|
if (N == 1) {
|
||||||
if (isa<FunctionTemplateDecl>(*Decls.begin()))
|
NamedDecl *D = (*Decls.begin())->getUnderlyingDecl();
|
||||||
|
if (isa<FunctionTemplateDecl>(D))
|
||||||
ResultKind = FoundOverloaded;
|
ResultKind = FoundOverloaded;
|
||||||
else if (isa<UnresolvedUsingValueDecl>(*Decls.begin()))
|
else if (isa<UnresolvedUsingValueDecl>(D))
|
||||||
ResultKind = FoundUnresolvedValue;
|
ResultKind = FoundUnresolvedValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,3 +56,19 @@ namespace test3 {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace test4 {
|
||||||
|
class X {
|
||||||
|
protected:
|
||||||
|
template<typename T> void f(T);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Y : public X {
|
||||||
|
public:
|
||||||
|
using X::f;
|
||||||
|
};
|
||||||
|
|
||||||
|
void test_f(Y y) {
|
||||||
|
y.f(17);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue