CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
92 lines
3.0 KiB
C++
92 lines
3.0 KiB
C++
// RUN: %clang_cc1 -std=c++20 -verify %s
|
|
|
|
namespace N0 {
|
|
template<int I>
|
|
concept C = I >= 4;
|
|
|
|
template<int I>
|
|
concept D = I < 8;
|
|
|
|
template<int I>
|
|
struct A { // #defined-here
|
|
constexpr static int f() { return 0; }
|
|
constexpr static int f() requires C<I> && D<I> { return 1; }
|
|
constexpr static int f() requires C<I> { return 2; }
|
|
|
|
constexpr static int g() requires C<I> { return 0; } // #candidate-0
|
|
constexpr static int g() requires D<I> { return 1; } // #candidate-1
|
|
|
|
constexpr static int h() requires C<I> { return 0; } // expected-note {{member declaration nearly matches}}
|
|
};
|
|
|
|
template<>
|
|
constexpr int A<2>::f() { return 3; }
|
|
|
|
template<>
|
|
constexpr int A<4>::f() { return 4; }
|
|
|
|
template<>
|
|
constexpr int A<8>::f() { return 5; }
|
|
|
|
static_assert(A<3>::f() == 0);
|
|
static_assert(A<5>::f() == 1);
|
|
static_assert(A<9>::f() == 2);
|
|
static_assert(A<2>::f() == 3);
|
|
static_assert(A<4>::f() == 4);
|
|
static_assert(A<8>::f() == 5);
|
|
|
|
template<>
|
|
constexpr int A<0>::g() { return 2; }
|
|
|
|
template<>
|
|
constexpr int A<8>::g() { return 3; }
|
|
|
|
template<>
|
|
constexpr int A<6>::g() { return 4; } // expected-error {{ambiguous member function specialization 'N0::A<6>::g' of 'N0::A::g'}}
|
|
// expected-note@#candidate-0 {{member function specialization matches 'g'}}
|
|
// expected-note@#candidate-1 {{member function specialization matches 'g'}}
|
|
|
|
static_assert(A<9>::g() == 0);
|
|
static_assert(A<1>::g() == 1);
|
|
static_assert(A<0>::g() == 2);
|
|
static_assert(A<8>::g() == 3);
|
|
|
|
template<>
|
|
constexpr int A<4>::h() { return 1; }
|
|
|
|
template<>
|
|
constexpr int A<0>::h() { return 2; } // expected-error {{out-of-line definition of 'h' does not match any declaration in 'N0::A<0>'}}
|
|
// expected-note@#defined-here {{defined here}}
|
|
|
|
static_assert(A<5>::h() == 0);
|
|
static_assert(A<4>::h() == 1);
|
|
} // namespace N0
|
|
|
|
namespace N1 {
|
|
template<int I>
|
|
concept C = I > 0;
|
|
|
|
template<int I>
|
|
concept D = I > 1;
|
|
|
|
template<int I>
|
|
concept E = I > 2;
|
|
|
|
template<int I>
|
|
struct A {
|
|
void f() requires C<I> && D<I>; // expected-note {{member function specialization matches 'f'}}
|
|
void f() requires C<I> && E<I>; // expected-note {{member function specialization matches 'f'}}
|
|
void f() requires C<I> && D<I> && true; // expected-note {{member function specialization matches 'f'}}
|
|
|
|
void g() requires C<I> && E<I>; // expected-note {{member function specialization matches 'g'}}
|
|
void g() requires C<I> && D<I>; // expected-note {{member function specialization matches 'g'}}
|
|
void g() requires C<I> && D<I> && true; // expected-note {{member function specialization matches 'g'}}
|
|
};
|
|
|
|
template<>
|
|
void A<3>::f(); // expected-error {{ambiguous member function specialization 'N1::A<3>::f' of 'N1::A::f'}}
|
|
|
|
template<>
|
|
void A<3>::g(); // expected-error {{ambiguous member function specialization 'N1::A<3>::g' of 'N1::A::g'}}
|
|
} // namespace N1
|