Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] constraints partial ordering should work with deduction guide
D128750 incorrectly skips constraints partial ordering for deduction guide. This patch reverts that part. Fixes #58456.
- Loading branch information
Yuanfang Chen
committed
Oct 19, 2022
1 parent
6912ed7
commit 13d6a57
Showing
2 changed files
with
21 additions
and
2 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
20 changes: 20 additions & 0 deletions
20
clang/test/SemaTemplate/deduction-guide-partial-ordering.cpp
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,20 @@ | ||
// RUN: %clang_cc1 -std=c++20 -verify %s | ||
// expected-no-diagnostics | ||
|
||
namespace pr58456 { | ||
template<typename> | ||
struct s { | ||
constexpr s(auto) { | ||
} | ||
}; | ||
|
||
template<typename T> | ||
s(T) -> s<int>; | ||
|
||
template<typename T> requires true | ||
s(T) -> s<int>; | ||
|
||
void f() { | ||
auto const y = s(0); | ||
} | ||
} |