Skip to content

Commit a4f9264

Browse files
committed
Fix a test case
the expressions don't subsume because they have different parameter mappings
1 parent ab53f2d commit a4f9264

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

clang/test/SemaTemplate/instantiate-template-argument.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,24 @@ concept C2 = C1<Y{}, V>;
99
// sizeof(U) >= 4 [U = V (decltype(Y{}))]
1010

1111
template<char W>
12-
constexpr int foo() requires C2<int, W> { return 1; }
12+
constexpr int foo() requires C2<int, W> { return 1; } // #cand1
1313
// sizeof(U) >= 4 [U = W (decltype(int{}))]
1414

1515
template<char X>
1616
// expected-note@+1{{candidate function}}
17-
constexpr int foo() requires C1<1, X> && true { return 2; }
17+
constexpr int foo() requires C1<1, X> && true { return 2; } // #cand2
1818
// sizeof(U) >= 4 [U = X (decltype(1))]
1919

20-
// GCC rejects it: https://godbolt.org/z/MWG756K8c
2120
static_assert(foo<'a'>() == 2);
21+
// expected-error@-1 {{call to 'foo' is ambiguous}}
22+
// expected-note@#cand1 {{candidate function}}
23+
// expected-note@#cand2 {{candidate function}}
2224

2325
template<char Z>
24-
// expected-note@+1{{candidate function}}
25-
constexpr int foo() requires C2<long long, Z> && true { return 3; }
26+
constexpr int foo() requires C2<long long, Z> && true { return 3; } // #cand3
2627
// sizeof(U) >= 4 [U = Z (decltype(long long{}))]
2728

2829
static_assert(foo<'a'>() == 3);
29-
// expected-error@-1{{call to 'foo' is ambiguous}}
30+
// expected-error@-1{{call to 'foo' is ambiguous}}
31+
// expected-note@#cand1 {{candidate function}}
32+
// expected-note@#cand3 {{candidate function}}

0 commit comments

Comments
 (0)