template concept convertible_to = true; template concept same_as = true; template concept integral = true; template concept W = requires(A a, B b) { { b.www } noexcept -> integral; }; template concept X = requires(T t) { t.xxx(42); typename T::xxx_t; T::xyz::member; }; template concept Y = requires(T t, U u) { t.yyy(u); }; template concept Z = requires(T t) { { t.zzz() } -> same_as; requires W; }; // Concept constraints in all three slots require X, Y, Z, and ad-hoc stuff. template requires Y && requires(T *t) { { t->aaa() } -> convertible_to; } void foo(T t) requires Z || 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#]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#]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 }