Fix overload resolution bug.
This commit is contained in:
@@ -884,9 +884,12 @@ ExprResult Sema::ActOnCXXReflectExpr(SourceLocation OpLoc,
|
||||
if (Found.isAmbiguous()) {
|
||||
return ExprError();
|
||||
} else if (Found.isOverloadedResult() && Found.end() - Found.begin() > 1) {
|
||||
Diag(Id.StartLocation, diag::err_reflect_overload_set)
|
||||
<< Id.getSourceRange();
|
||||
return ExprError();
|
||||
Expr *Result = UnresolvedLookupExpr::Create(
|
||||
Context, nullptr, SS.getWithLocInContext(Context),
|
||||
SourceLocation(), NameInfo, false, TArgs, Found.begin(),
|
||||
Found.end(), false, false);
|
||||
|
||||
return BuildCXXReflectExpr(OpLoc, Result);
|
||||
}
|
||||
|
||||
NamedDecl *ND = Found.getRepresentativeDecl();
|
||||
|
||||
@@ -199,6 +199,18 @@ void fn(int p) {
|
||||
}
|
||||
} // namespace requires_expressions
|
||||
|
||||
// ===================
|
||||
// overload_resolution
|
||||
// ===================
|
||||
|
||||
namespace overload_resolution {
|
||||
template <typename T> void fn() requires (^^T != ^^int);
|
||||
template <typename T> void fn() requires (^^T == ^^int);
|
||||
template <typename T> void fn() requires (sizeof(T) == sizeof(int));
|
||||
|
||||
[[maybe_unused]] constexpr auto a = ^^fn<char>; // OK
|
||||
} // namespace overload_resolution
|
||||
|
||||
// =======================================
|
||||
// bb_clang_p2996_issue_35_regression_test
|
||||
// =======================================
|
||||
|
||||
Reference in New Issue
Block a user