diff options
author | Utkarsh Saxena <usx@google.com> | 2022-11-29 14:05:53 +0100 |
---|---|---|
committer | Utkarsh Saxena <usx@google.com> | 2022-12-19 20:22:03 +0100 |
commit | b3ce87285186ba190103a90b0b49da2e45fb7d1f (patch) | |
tree | 402e42646a9f56b0e45dad4669fd7bb315a6a437 /clang/lib/Frontend/ModuleDependencyCollector.cpp | |
parent | 81616561c1b376af85365c9eaf94d49ad184c623 (diff) | |
download | llvm-b3ce87285186ba190103a90b0b49da2e45fb7d1f.zip llvm-b3ce87285186ba190103a90b0b49da2e45fb7d1f.tar.gz llvm-b3ce87285186ba190103a90b0b49da2e45fb7d1f.tar.bz2 |
Make evaluation of nested requirement consistent with requires expr.
Fixes: https://github.com/llvm/llvm-project/issues/45563
```
template<class T> concept True = true;
template <class T>
concept C1 = requires (T) {
requires True<typename T::value> || True<T>;
};
template <class T>
constexpr bool foo()
requires True<typename T::value> || True<T> {
return true;
}
static_assert(C1<double>); // Previously failed due to SFINAE error
static_assert(foo<int>()); // but this works fine.
```
The issue here is the discrepancy between how a [nested requirement is evaluated](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplateInstantiate.cpp#L2331) Vs how a [non-nested requirement is evaluated](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaConcept.cpp#L167-L200).
This patch makes constraint checking consistent for nested requirement
and trailing requires expressions by reusing the same evaluator.
Differential Revision: https://reviews.llvm.org/D138914
Diffstat (limited to 'clang/lib/Frontend/ModuleDependencyCollector.cpp')
0 files changed, 0 insertions, 0 deletions