-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][Sema] Fix issue on requires expression with templated base cl…
…ass member function (#85198) Fix #84020 Skip checking implicit object parameter in the context of `RequiresExprBodyDecl`. Co-authored-by: huqizhi <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// RUN: %clang_cc1 -std=c++20 -verify %s | ||
// RUN: %clang_cc1 -std=c++23 -verify %s | ||
// expected-no-diagnostics | ||
|
||
struct B { | ||
template <typename S> | ||
void foo(); | ||
|
||
void bar(); | ||
}; | ||
|
||
template <typename T, typename S> | ||
struct A : T { | ||
auto foo() { | ||
static_assert(requires { T::template foo<S>(); }); | ||
static_assert(requires { T::bar(); }); | ||
} | ||
}; | ||
|
||
int main() { | ||
A<B, double> a; | ||
a.foo(); | ||
} |