Files
TheRock/compiler/amd-llvm/clang/test/CodeCompletion/concepts.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

60 lines
2.0 KiB
C++

template <typename T, typename U> concept convertible_to = true;
template <typename T, typename U> concept same_as = true;
template <typename T> concept integral = true;
template <typename A, typename B>
concept W = requires(A a, B b) {
{ b.www } noexcept -> integral;
};
template <typename T> concept X = requires(T t) {
t.xxx(42);
typename T::xxx_t;
T::xyz::member;
};
template <typename T, typename U>
concept Y = requires(T t, U u) { t.yyy(u); };
template <typename T>
concept Z = requires(T t) {
{ t.zzz() } -> same_as<int>;
requires W<int, T>;
};
// Concept constraints in all three slots require X, Y, Z, and ad-hoc stuff.
template <X T>
requires Y<T, int> && requires(T *t) { { t->aaa() } -> convertible_to<double>; }
void foo(T t) requires Z<T> || requires(T &t) { t.bbb(); t->bb(); } {
t.x;
t->x;
T::x;
// RUN: %clang_cc1 -std=c++2a -code-completion-with-fixits -code-completion-at=%s:29:5 %s \
// RUN: | FileCheck %s -check-prefix=DOT -implicit-check-not=xxx_t
// DOT: Pattern : [#convertible_to<double>#]aaa()
// DOT: Pattern : bb() (requires fix-it: {{.*}} to "->")
// DOT: Pattern : bbb()
// DOT: Pattern : [#integral#]www
// DOT: Pattern : xxx(<#int#>)
// FIXME: it would be nice to have int instead of U here.
// DOT: Pattern : yyy(<#U#>)
// DOT: Pattern : [#int#]zzz()
// RUN: %clang_cc1 -std=c++2a -code-completion-with-fixits -code-completion-at=%s:30:6 %s \
// RUN: | FileCheck %s -check-prefix=ARROW -implicit-check-not=xxx_t
// ARROW: Pattern : [#convertible_to<double>#]aaa() (requires fix-it: {{.*}} to ".")
// ARROW: Pattern : bb()
// ARROW: Pattern : bbb() (requires fix-it
// ARROW: Pattern : [#integral#]www (requires fix-it
// ARROW: Pattern : xxx(<#int#>) (requires fix-it
// ARROW: Pattern : yyy(<#U#>) (requires fix-it
// ARROW: Pattern : [#int#]zzz() (requires fix-it
// RUN: %clang_cc1 -std=c++2a -code-completion-with-fixits -code-completion-at=%s:31:6 %s \
// RUN: | FileCheck %s -check-prefix=COLONS -implicit-check-not=yyy
// COLONS: Pattern : xxx_t
// COLONS: Pattern : xyz
}