Skip to content

release/19.x: [Clang] Remove the special-casing for RequiresExprBodyDecl in BuildResolvedCallExpr() after fd87d765c0 (#111277) #111324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6922,8 +6922,7 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
}

if (CXXMethodDecl *Method = dyn_cast_or_null<CXXMethodDecl>(FDecl))
if (!isa<RequiresExprBodyDecl>(CurContext) &&
Method->isImplicitObjectMemberFunction())
if (Method->isImplicitObjectMemberFunction())
return ExprError(Diag(LParenLoc, diag::err_member_call_without_object)
<< Fn->getSourceRange() << 0);

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/TreeTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -13608,7 +13608,7 @@ bool TreeTransform<Derived>::TransformOverloadExprDecls(OverloadExpr *Old,
}

AllEmptyPacks &= Decls.empty();
};
}

// C++ [temp.res]/8.4.2:
// The program is ill-formed, no diagnostic required, if [...] lookup for
Expand Down
23 changes: 0 additions & 23 deletions clang/test/SemaCXX/PR84020.cpp

This file was deleted.

31 changes: 31 additions & 0 deletions clang/test/SemaTemplate/instantiate-requires-expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,34 @@ constexpr bool e_v = true;
static_assert(e_v<bool>);

} // namespace GH73885

namespace GH84020 {

struct B {
template <typename S> void foo();
void bar();
};

template <typename T, typename S> struct A : T {
void foo() {
static_assert(requires { T::template foo<S>(); });
static_assert(requires { T::bar(); });
}
};

template class A<B, double>;

} // namespace GH84020

namespace GH110785 {

struct Foo {
static void f(auto) requires(false) {}
void f(int) {}

static_assert([](auto v) {
return requires { f(v); };
} (0) == false);
};

} // namespace GH110785
Loading