Skip to content

Commit ad5dc97

Browse files
committed
Address Aarons's feedback
1 parent ad4df6d commit ad5dc97

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/include/clang/Sema/Overload.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,8 @@ class Sema;
10021002
/// using either a parenthesized or braced list of arguments.
10031003
CSK_InitByConstructor,
10041004

1005+
/// C++ [over.match.call.general]
1006+
/// Resolve a call through the address of an overload set.
10051007
CSK_AddressOfOverloadSet,
10061008
};
10071009

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5826,11 +5826,11 @@ static bool isParenthetizedAndQualifiedAddressOfExpr(Expr *Fn) {
58265826
if (!UO || UO->getOpcode() != clang::UO_AddrOf)
58275827
return false;
58285828
if (auto *DRE = dyn_cast<DeclRefExpr>(UO->getSubExpr()->IgnoreParens())) {
5829+
assert(isa<FunctionDecl>(DRE->getDecl()) && "expected a function");
58295830
return DRE->hasQualifier();
58305831
}
5831-
if (auto *OVL = dyn_cast<OverloadExpr>(UO->getSubExpr()->IgnoreParens())) {
5832+
if (auto *OVL = dyn_cast<OverloadExpr>(UO->getSubExpr()->IgnoreParens()))
58325833
return OVL->getQualifier();
5833-
}
58345834
return false;
58355835
}
58365836

0 commit comments

Comments
 (0)