-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement suggested fix for [[ https://cplusplus.github.io/CWG/issues/2628.html | DR2628. ]] Couldn't update the DR docs because there hasn't been a DR index since it was filed, but the tests still run in CI. Note: I only transfer the constructor constraints, not the struct constraints. I think that's OK because the struct constraints are the same for all constructors so they don't affect the overload resolution, and if they deduce to something that doesn't pass the constraints we catch it anyway. So (hopefully) that should be more efficient without sacrificing correctness. Closes: #57646 #43829 Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D134145
- Loading branch information
1 parent
ce39bdb
commit 368b683
Showing
3 changed files
with
22 additions
and
0 deletions.
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,16 @@ | ||
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify | ||
|
||
namespace dr2628 { // dr2628: yes | ||
|
||
template <bool A = false, bool B = false> | ||
struct foo { | ||
constexpr foo() requires (!A && !B) = delete; // #DR2628_CTOR | ||
constexpr foo() requires (A || B) = delete; | ||
}; | ||
|
||
void f() { | ||
foo fooable; // expected-error {{call to deleted}} | ||
// expected-note@#DR2628_CTOR {{marked deleted here}} | ||
} | ||
|
||
} |