forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverting accidental git-revert commits.
Revert "Revert "Revert "Revert "[Concepts] Fix overload resolution bug with constrained candidates"""" This reverts commit cfc2c59.
- Loading branch information
Showing
5 changed files
with
129 additions
and
45 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
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
49 changes: 49 additions & 0 deletions
49
clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.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,49 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s | ||
|
||
struct A; | ||
struct B; | ||
|
||
template <typename> constexpr bool True = true; | ||
template <typename T> concept C = True<T>; | ||
|
||
void f(C auto &, auto &) = delete; | ||
template <C Q> void f(Q &, C auto &); | ||
|
||
void g(struct A *ap, struct B *bp) { | ||
f(*ap, *bp); | ||
} | ||
|
||
template <typename T, typename U> struct X {}; | ||
|
||
template <typename T, C U, typename V> bool operator==(X<T, U>, V) = delete; | ||
template <C T, C U, C V> bool operator==(T, X<U, V>); | ||
|
||
bool h() { | ||
return X<void *, int>{} == 0; | ||
} | ||
|
||
namespace PR53640 { | ||
|
||
template <typename T> | ||
concept C = true; | ||
|
||
template <C T> | ||
void f(T t) {} // expected-note {{candidate function [with T = int]}} | ||
|
||
template <typename T> | ||
void f(const T &t) {} // expected-note {{candidate function [with T = int]}} | ||
|
||
int g() { | ||
f(0); // expected-error {{call to 'f' is ambiguous}} | ||
} | ||
|
||
struct S { | ||
template <typename T> explicit S(T) noexcept requires C<T> {} // expected-note {{candidate constructor}} | ||
template <typename T> explicit S(const T &) noexcept {} // expected-note {{candidate constructor}} | ||
}; | ||
|
||
int h() { | ||
S s(4); // expected-error-re {{call to constructor of {{.*}} is ambiguous}} | ||
} | ||
|
||
} |