forked from OSchip/llvm-project
Resolve exception specifications when selecting an overloaded operator.
llvm-svn: 284556
This commit is contained in:
parent
87378bd21e
commit
5f4b388442
|
@ -60,6 +60,8 @@ CreateFunctionRefExpr(Sema &S, FunctionDecl *Fn, NamedDecl *FoundDecl,
|
|||
// being used.
|
||||
if (FoundDecl != Fn && S.DiagnoseUseOfDecl(Fn, Loc))
|
||||
return ExprError();
|
||||
if (auto *FPT = Fn->getType()->getAs<FunctionProtoType>())
|
||||
S.ResolveExceptionSpec(Loc, FPT);
|
||||
DeclRefExpr *DRE = new (S.Context) DeclRefExpr(Fn, false, Fn->getType(),
|
||||
VK_LValue, Loc, LocInfo);
|
||||
if (HadMultipleCandidates)
|
||||
|
|
|
@ -33,7 +33,9 @@ namespace NoexceptFunctionTypes {
|
|||
template<typename T> struct A {
|
||||
constexpr bool f() noexcept(true) { return true; }
|
||||
constexpr bool g() { return f(); }
|
||||
constexpr bool operator()() const noexcept(true) { return true; }
|
||||
};
|
||||
static_assert(A<int>().f());
|
||||
static_assert(A<int>().g());
|
||||
static_assert(A<int>()());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue