Skip to content

Commit 9956038

Browse files
committed
[Clang] Remove the special-casing for RequiresExprBodyDecl in BuildResolvedCallExpr() after fd87d76
1 parent b837c9e commit 9956038

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6963,8 +6963,7 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
69636963
}
69646964

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

clang/lib/Sema/TreeTransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13907,7 +13907,7 @@ bool TreeTransform<Derived>::TransformOverloadExprDecls(OverloadExpr *Old,
1390713907
}
1390813908

1390913909
AllEmptyPacks &= Decls.empty();
13910-
};
13910+
}
1391113911

1391213912
// C++ [temp.res]/8.4.2:
1391313913
// The program is ill-formed, no diagnostic required, if [...] lookup for

clang/test/SemaCXX/PR84020.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

clang/test/SemaTemplate/instantiate-requires-expr.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,34 @@ constexpr bool e_v = true;
237237
static_assert(e_v<bool>);
238238

239239
} // namespace GH73885
240+
241+
namespace GH84020 {
242+
243+
struct B {
244+
template <typename S> void foo();
245+
void bar();
246+
};
247+
248+
template <typename T, typename S> struct A : T {
249+
void foo() {
250+
static_assert(requires { T::template foo<S>(); });
251+
static_assert(requires { T::bar(); });
252+
}
253+
};
254+
255+
template class A<B, double>;
256+
257+
} // namespace GH84020
258+
259+
namespace GH110785 {
260+
261+
struct Foo {
262+
static void f(auto) requires(false) {}
263+
void f(int) {}
264+
265+
static_assert([](auto v) {
266+
return requires { f(v); };
267+
} (0) == false);
268+
};
269+
270+
} // namespace GH110785

0 commit comments

Comments
 (0)