615 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 -DSTD1 %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 -DSTD2 %s3// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 -DSTD3 %s4 5namespace std {6 7#ifdef STD18template <typename T>9struct is_trivially_relocatable {10 static constexpr bool value = __builtin_is_cpp_trivially_relocatable(T);11};12 13template <typename T>14constexpr bool is_trivially_relocatable_v = __builtin_is_cpp_trivially_relocatable(T);15 16template <typename T>17struct is_trivially_copyable {18 static constexpr bool value = __is_trivially_copyable(T);19};20 21template <typename T>22constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T);23 24template <typename T, typename U>25struct is_assignable {26 static constexpr bool value = __is_assignable(T, U);27};28 29template <typename T, typename U>30constexpr bool is_assignable_v = __is_assignable(T, U);31 32template <typename T>33struct is_empty {34 static constexpr bool value = __is_empty(T);35};36template <typename T>37constexpr bool is_empty_v = __is_empty(T);38 39template <typename T>40struct is_standard_layout {41static constexpr bool value = __is_standard_layout(T);42};43template <typename T>44constexpr bool is_standard_layout_v = __is_standard_layout(T);45 46template <typename... Args>47struct is_constructible {48 static constexpr bool value = __is_constructible(Args...);49};50 51template <typename... Args>52constexpr bool is_constructible_v = __is_constructible(Args...);53 54template <typename T>55struct is_aggregate {56 static constexpr bool value = __is_aggregate(T);57};58 59template <typename T>60constexpr bool is_aggregate_v = __is_aggregate(T);61 62template <typename T>63struct is_final {64 static constexpr bool value = __is_final(T);65};66template <typename T>67constexpr bool is_final_v = __is_final(T);68 69template <typename T>70struct is_abstract {71 static constexpr bool value = __is_abstract(T);72};73template <typename T>74constexpr bool is_abstract_v = __is_abstract(T);75 76#endif77 78#ifdef STD279template <typename T>80struct __details_is_trivially_relocatable {81 static constexpr bool value = __builtin_is_cpp_trivially_relocatable(T);82};83 84template <typename T>85using is_trivially_relocatable = __details_is_trivially_relocatable<T>;86 87template <typename T>88constexpr bool is_trivially_relocatable_v = __builtin_is_cpp_trivially_relocatable(T);89 90template <typename T>91struct __details_is_trivially_copyable {92 static constexpr bool value = __is_trivially_copyable(T);93};94 95template <typename T>96using is_trivially_copyable = __details_is_trivially_copyable<T>;97 98template <typename T>99constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T);100 101template <typename T, typename U>102struct __details_is_assignable {103 static constexpr bool value = __is_assignable(T, U);104};105 106template <typename T, typename U>107using is_assignable = __details_is_assignable<T, U>;108 109template <typename T, typename U>110constexpr bool is_assignable_v = __is_assignable(T, U);111 112template <typename T>113struct __details_is_empty {114 static constexpr bool value = __is_empty(T);115};116template <typename T>117using is_empty = __details_is_empty<T>;118template <typename T>119constexpr bool is_empty_v = __is_empty(T);120 121template <typename T>122struct __details_is_standard_layout {123 static constexpr bool value = __is_standard_layout(T);124};125template <typename T>126using is_standard_layout = __details_is_standard_layout<T>;127template <typename T>128constexpr bool is_standard_layout_v = __is_standard_layout(T);129 130template <typename... Args>131struct __details_is_constructible{132 static constexpr bool value = __is_constructible(Args...);133};134 135template <typename... Args>136using is_constructible = __details_is_constructible<Args...>;137 138template <typename... Args>139constexpr bool is_constructible_v = __is_constructible(Args...);140 141template <typename T>142struct __details_is_aggregate {143 static constexpr bool value = __is_aggregate(T);144};145 146template <typename T>147using is_aggregate = __details_is_aggregate<T>;148 149template <typename T>150constexpr bool is_aggregate_v = __is_aggregate(T);151 152template <typename T>153struct __details_is_final {154 static constexpr bool value = __is_final(T);155};156template <typename T>157using is_final = __details_is_final<T>;158template <typename T>159constexpr bool is_final_v = __is_final(T);160 161template <typename T>162struct __details_is_abstract {163 static constexpr bool value = __is_abstract(T);164};165template <typename T>166using is_abstract = __details_is_abstract<T>;167template <typename T>168constexpr bool is_abstract_v = __is_abstract(T);169 170#endif171 172 173#ifdef STD3174template< class T, T v >175struct integral_constant {176 static constexpr T value = v;177};178 179template< bool B >180using bool_constant = integral_constant<bool, B>;181 182template <typename T>183struct __details_is_trivially_relocatable : bool_constant<__builtin_is_cpp_trivially_relocatable(T)> {};184 185template <typename T>186using is_trivially_relocatable = __details_is_trivially_relocatable<T>;187 188template <typename T>189constexpr bool is_trivially_relocatable_v = is_trivially_relocatable<T>::value;190 191template <typename T>192struct __details_is_trivially_copyable : bool_constant<__is_trivially_copyable(T)> {};193 194template <typename T>195using is_trivially_copyable = __details_is_trivially_copyable<T>;196 197template <typename T>198constexpr bool is_trivially_copyable_v = is_trivially_copyable<T>::value;199 200template <typename T, typename U>201struct __details_is_assignable : bool_constant<__is_assignable(T, U)> {};202 203template <typename T, typename U>204using is_assignable = __details_is_assignable<T, U>;205 206template <typename T, typename U>207constexpr bool is_assignable_v = is_assignable<T, U>::value;208 209template <typename T>210struct __details_is_empty : bool_constant<__is_empty(T)> {};211template <typename T>212using is_empty = __details_is_empty<T>;213template <typename T>214constexpr bool is_empty_v = is_empty<T>::value;215 216template <typename T>217struct __details_is_standard_layout : bool_constant<__is_standard_layout(T)> {};218template <typename T>219using is_standard_layout = __details_is_standard_layout<T>;220template <typename T>221constexpr bool is_standard_layout_v = is_standard_layout<T>::value;222 223template <typename... Args>224struct __details_is_constructible : bool_constant<__is_constructible(Args...)> {};225 226template <typename... Args>227using is_constructible = __details_is_constructible<Args...>;228 229template <typename... Args>230constexpr bool is_constructible_v = is_constructible<Args...>::value;231 232template <typename T>233struct __details_is_aggregate : bool_constant<__is_aggregate(T)> {};234 235template <typename T>236using is_aggregate = __details_is_aggregate<T>;237 238template <typename T>239constexpr bool is_aggregate_v = is_aggregate<T>::value;240 241template <typename T>242struct __details_is_final : bool_constant<__is_final(T)> {};243template <typename T>244using is_final = __details_is_final<T>;245template <typename T>246constexpr bool is_final_v = is_final<T>::value;247 248template <typename T>249struct __details_is_abstract : bool_constant<__is_abstract(T)> {};250template <typename T>251using is_abstract = __details_is_abstract<T>;252template <typename T>253constexpr bool is_abstract_v = is_abstract<T>::value;254 255#endif256}257 258static_assert(std::is_trivially_relocatable<int>::value);259 260static_assert(std::is_trivially_relocatable<int&>::value);261// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_trivially_relocatable<int &>::value'}} \262// expected-note@-1 {{'int &' is not trivially relocatable}} \263// expected-note@-1 {{because it is a reference type}}264static_assert(std::is_trivially_relocatable_v<int&>);265// expected-error@-1 {{static assertion failed due to requirement 'std::is_trivially_relocatable_v<int &>'}} \266// expected-note@-1 {{'int &' is not trivially relocatable}} \267// expected-note@-1 {{because it is a reference type}}268 269static_assert(std::is_trivially_copyable<int>::value);270 271static_assert(std::is_trivially_copyable<int&>::value);272// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_trivially_copyable<int &>::value'}} \273// expected-note@-1 {{'int &' is not trivially copyable}} \274// expected-note@-1 {{because it is a reference type}}275static_assert(std::is_trivially_copyable_v<int&>);276// expected-error@-1 {{static assertion failed due to requirement 'std::is_trivially_copyable_v<int &>'}} \277// expected-note@-1 {{'int &' is not trivially copyable}} \278// expected-note@-1 {{because it is a reference type}}279 280 281 // Direct tests282 static_assert(std::is_standard_layout<int>::value);283 static_assert(std::is_standard_layout_v<int>);284 285 static_assert(std::is_standard_layout<int&>::value);286 // expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_standard_layout<int &>::value'}} \287 // expected-note@-1 {{'int &' is not standard-layout}} \288 // expected-note@-1 {{because it is a reference type}}289 290 static_assert(std::is_standard_layout_v<int&>);291 // expected-error@-1 {{static assertion failed due to requirement 'std::is_standard_layout_v<int &>'}} \292 // expected-note@-1 {{'int &' is not standard-layout}} \293 // expected-note@-1 {{because it is a reference type}}294 295static_assert(!std::is_empty<int>::value);296 297static_assert(std::is_empty<int&>::value);298// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_empty<int &>::value'}} \299// expected-note@-1 {{'int &' is not empty}} \300// expected-note@-1 {{because it is a reference type}}301static_assert(std::is_empty_v<int&>);302// expected-error@-1 {{static assertion failed due to requirement 'std::is_empty_v<int &>'}} \303// expected-note@-1 {{'int &' is not empty}} \304// expected-note@-1 {{because it is a reference type}}305 306 307static_assert(std::is_assignable<int&, int>::value);308 309static_assert(std::is_assignable<int&, void>::value);310// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_assignable<int &, void>::value'}} \311// expected-error@-1 {{assigning to 'int' from incompatible type 'void'}}312static_assert(std::is_assignable_v<int&, void>);313// expected-error@-1 {{static assertion failed due to requirement 'std::is_assignable_v<int &, void>'}} \314// expected-error@-1 {{assigning to 'int' from incompatible type 'void'}}315 316static_assert(std::is_constructible<int, int>::value);317 318static_assert(std::is_constructible<void>::value);319// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_constructible<void>::value'}} \320// expected-note@-1 {{because it is a cv void type}}321static_assert(std::is_constructible_v<void>);322// expected-error@-1 {{static assertion failed due to requirement 'std::is_constructible_v<void>'}} \323// expected-note@-1 {{because it is a cv void type}}324 325static_assert(!std::is_final<int>::value);326 327static_assert(std::is_final<int&>::value);328// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_final<int &>::value'}} \329// expected-note@-1 {{'int &' is not final}} \330// expected-note@-1 {{because it is a reference type}} \331// expected-note@-1 {{because it is not a class or union type}}332 333static_assert(std::is_final_v<int&>);334// expected-error@-1 {{static assertion failed due to requirement 'std::is_final_v<int &>'}} \335// expected-note@-1 {{'int &' is not final}} \336// expected-note@-1 {{because it is a reference type}} \337// expected-note@-1 {{because it is not a class or union type}}338 339using Arr = int[3];340static_assert(std::is_final<Arr>::value);341// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_final<int[3]>::value'}} \342// expected-note@-1 {{'Arr' (aka 'int[3]') is not final}} \343// expected-note@-1 {{because it is not a class or union type}}344 345static_assert(std::is_final_v<Arr>);346// expected-error@-1 {{static assertion failed due to requirement 'std::is_final_v<int[3]>'}} \347// expected-note@-1 {{'int[3]' is not final}} \348// expected-note@-1 {{because it is not a class or union type}}349 350 351static_assert(!std::is_aggregate<int>::value);352 353static_assert(std::is_aggregate<void>::value);354// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_aggregate<void>::value'}} \355// expected-note@-1 {{'void' is not aggregate}} \356// expected-note@-1 {{because it is a cv void type}}357static_assert(std::is_aggregate_v<void>);358// expected-error@-1 {{static assertion failed due to requirement 'std::is_aggregate_v<void>'}} \359// expected-note@-1 {{'void' is not aggregate}} \360// expected-note@-1 {{because it is a cv void type}}361 362 363static_assert(!std::is_abstract<int>::value);364 365static_assert(std::is_abstract<int&>::value);366// expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_abstract<int &>::value'}} \367// expected-note@-1 {{'int &' is not abstract}} \368// expected-note@-1 {{because it is a reference type}} \369// expected-note@-1 {{because it is not a struct or class type}}370 371static_assert(std::is_abstract_v<int&>);372// expected-error@-1 {{static assertion failed due to requirement 'std::is_abstract_v<int &>'}} \373// expected-note@-1 {{'int &' is not abstract}} \374// expected-note@-1 {{because it is a reference type}} \375// expected-note@-1 {{because it is not a struct or class type}}376 377 378namespace test_namespace {379 using namespace std;380 static_assert(is_trivially_relocatable<int&>::value);381 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_trivially_relocatable<int &>::value'}} \382 // expected-note@-1 {{'int &' is not trivially relocatable}} \383 // expected-note@-1 {{because it is a reference type}}384 static_assert(is_trivially_relocatable_v<int&>);385 // expected-error@-1 {{static assertion failed due to requirement 'is_trivially_relocatable_v<int &>'}} \386 // expected-note@-1 {{'int &' is not trivially relocatable}} \387 // expected-note@-1 {{because it is a reference type}}388 389 static_assert(is_trivially_copyable<int&>::value);390 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_trivially_copyable<int &>::value'}} \391 // expected-note@-1 {{'int &' is not trivially copyable}} \392 // expected-note@-1 {{because it is a reference type}}393 static_assert(is_trivially_copyable_v<int&>);394 // expected-error@-1 {{static assertion failed due to requirement 'is_trivially_copyable_v<int &>'}} \395 // expected-note@-1 {{'int &' is not trivially copyable}} \396 // expected-note@-1 {{because it is a reference type}}397 398 static_assert(is_standard_layout<int&>::value);399 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_standard_layout<int &>::value'}} \400 // expected-note@-1 {{'int &' is not standard-layout}} \401 // expected-note@-1 {{because it is a reference type}}402 403 static_assert(is_standard_layout_v<int&>);404 // expected-error@-1 {{static assertion failed due to requirement 'is_standard_layout_v<int &>'}} \405 // expected-note@-1 {{'int &' is not standard-layout}} \406 // expected-note@-1 {{because it is a reference type}}407 408 static_assert(is_assignable<int&, void>::value);409 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_assignable<int &, void>::value'}} \410 // expected-error@-1 {{assigning to 'int' from incompatible type 'void'}}411 static_assert(is_assignable_v<int&, void>);412 // expected-error@-1 {{static assertion failed due to requirement 'is_assignable_v<int &, void>'}} \413 // expected-error@-1 {{assigning to 'int' from incompatible type 'void'}}414 415 static_assert(is_empty<int&>::value);416 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_empty<int &>::value'}} \417 // expected-note@-1 {{'int &' is not empty}} \418 // expected-note@-1 {{because it is a reference type}} 419 static_assert(is_empty_v<int&>);420 // expected-error@-1 {{static assertion failed due to requirement 'is_empty_v<int &>'}} \421 // expected-note@-1 {{'int &' is not empty}} \422 // expected-note@-1 {{because it is a reference type}}423 424 static_assert(is_constructible<void>::value);425 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_constructible<void>::value'}} \426 // expected-note@-1 {{because it is a cv void type}}427 static_assert(is_constructible_v<void>);428 // expected-error@-1 {{static assertion failed due to requirement 'is_constructible_v<void>'}} \429 // expected-note@-1 {{because it is a cv void type}}430 431 static_assert(std::is_aggregate<void>::value);432 // expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_aggregate<void>::value'}} \433 // expected-note@-1 {{'void' is not aggregate}} \434 // expected-note@-1 {{because it is a cv void type}}435 static_assert(std::is_aggregate_v<void>);436 // expected-error@-1 {{static assertion failed due to requirement 'std::is_aggregate_v<void>'}} \437 // expected-note@-1 {{'void' is not aggregate}} \438 // expected-note@-1 {{because it is a cv void type}}439 440 static_assert(is_final<int&>::value);441 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_final<int &>::value'}} \442 // expected-note@-1 {{'int &' is not final}} \443 // expected-note@-1 {{because it is a reference type}} \444 // expected-note@-1 {{because it is not a class or union type}}445 446 static_assert(is_final_v<int&>);447 // expected-error@-1 {{static assertion failed due to requirement 'is_final_v<int &>'}} \448 // expected-note@-1 {{'int &' is not final}} \449 // expected-note@-1 {{because it is a reference type}} \450 // expected-note@-1 {{because it is not a class or union type}}451 452 using A = int[2];453 static_assert(is_final<A>::value);454 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_final<int[2]>::value'}} \455 // expected-note@-1 {{'A' (aka 'int[2]') is not final}} \456 // expected-note@-1 {{because it is not a class or union type}}457 458 using Fn = void();459 static_assert(is_final<Fn>::value);460 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_final<void ()>::value'}} \461 // expected-note@-1 {{'Fn' (aka 'void ()') is not final}} \462 // expected-note@-1 {{because it is a function type}} \463 // expected-note@-1 {{because it is not a class or union type}}464 465 static_assert(is_abstract<int&>::value);466 // expected-error-re@-1 {{static assertion failed due to requirement '{{.*}}is_abstract<int &>::value'}} \467 // expected-note@-1 {{'int &' is not abstract}} \468 // expected-note@-1 {{because it is a reference type}} \469 // expected-note@-1 {{because it is not a struct or class type}}470 471 static_assert(is_abstract_v<int&>);472 // expected-error@-1 {{static assertion failed due to requirement 'is_abstract_v<int &>'}} \473 // expected-note@-1 {{'int &' is not abstract}} \474 // expected-note@-1 {{because it is a reference type}} \475 // expected-note@-1 {{because it is not a struct or class type}}476}477 478 479namespace concepts {480template <typename T>481requires std::is_trivially_relocatable<T>::value void f(); // #cand1482 483template <typename T>484concept C = std::is_trivially_relocatable_v<T>; // #concept2485 486template <C T> void g(); // #cand2487 488template <typename T>489requires std::is_trivially_copyable<T>::value void f2(); // #cand3490 491template <typename T>492concept C2 = std::is_trivially_copyable_v<T>; // #concept4493 494template <C2 T> void g2(); // #cand4495 496template <typename T, typename U>497requires std::is_assignable<T, U>::value void f4(); // #cand7498 499template <typename T, typename U>500concept C4 = std::is_assignable_v<T, U>; // #concept8501 502template <C4<void> T> void g4(); // #cand8503 504template <typename... Args>505requires std::is_constructible<Args...>::value void f3(); // #cand5506 507template <typename... Args>508concept C3 = std::is_constructible_v<Args...>; // #concept6509 510template <C3 T> void g3(); // #cand6511 512 513template <typename T>514requires std::is_aggregate<T>::value void f5(); // #cand9515 516template <typename T>517concept C5 = std::is_aggregate_v<T>; // #concept10518 519template <C5 T> void g5(); // #cand10520 521void test() {522 f<int&>();523 // expected-error@-1 {{no matching function for call to 'f'}} \524 // expected-note@#cand1 {{candidate template ignored: constraints not satisfied [with T = int &]}} \525 // expected-note-re@#cand1 {{because '{{.*}}is_trivially_relocatable<int &>::value' evaluated to false}} \526 // expected-note@#cand1 {{'int &' is not trivially relocatable}} \527 // expected-note@#cand1 {{because it is a reference type}}528 529 g<int&>();530 // expected-error@-1 {{no matching function for call to 'g'}} \531 // expected-note@#cand2 {{candidate template ignored: constraints not satisfied [with T = int &]}} \532 // expected-note@#cand2 {{because 'int &' does not satisfy 'C'}} \533 // expected-note@#concept2 {{because 'std::is_trivially_relocatable_v<int &>' evaluated to false}} \534 // expected-note@#concept2 {{'int &' is not trivially relocatable}} \535 // expected-note@#concept2 {{because it is a reference type}}536 537 f2<int&>();538 // expected-error@-1 {{no matching function for call to 'f2'}} \539 // expected-note@#cand3 {{candidate template ignored: constraints not satisfied [with T = int &]}} \540 // expected-note-re@#cand3 {{because '{{.*}}is_trivially_copyable<int &>::value' evaluated to false}} \541 // expected-note@#cand3 {{'int &' is not trivially copyable}} \542 // expected-note@#cand3 {{because it is a reference type}}543 544 g2<int&>();545 // expected-error@-1 {{no matching function for call to 'g2'}} \546 // expected-note@#cand4 {{candidate template ignored: constraints not satisfied [with T = int &]}} \547 // expected-note@#cand4 {{because 'int &' does not satisfy 'C2'}} \548 // expected-note@#concept4 {{because 'std::is_trivially_copyable_v<int &>' evaluated to false}} \549 // expected-note@#concept4 {{'int &' is not trivially copyable}} \550 // expected-note@#concept4 {{because it is a reference type}}551 552 f4<int&, void>();553 // expected-error@-1 {{no matching function for call to 'f4'}} \554 // expected-note@#cand7 {{candidate template ignored: constraints not satisfied [with T = int &, U = void]}} \555 // expected-note-re@#cand7 {{because '{{.*}}is_assignable<int &, void>::value' evaluated to false}} \556 // expected-error@#cand7 {{assigning to 'int' from incompatible type 'void'}}557 558 g4<int&>();559 // expected-error@-1 {{no matching function for call to 'g4'}} \560 // expected-note@#cand8 {{candidate template ignored: constraints not satisfied [with T = int &]}} \561 // expected-note@#cand8 {{because 'C4<int &, void>' evaluated to false}} \562 // expected-note@#concept8 {{because 'std::is_assignable_v<int &, void>' evaluated to false}} \563 // expected-error@#concept8 {{assigning to 'int' from incompatible type 'void'}}564 565 f3<void>();566 // expected-error@-1 {{no matching function for call to 'f3'}} \567 // expected-note@#cand5 {{candidate template ignored: constraints not satisfied [with Args = <void>]}} \568 // expected-note-re@#cand5 {{because '{{.*}}is_constructible<void>::value' evaluated to false}} \569 // expected-note@#cand5 {{because it is a cv void type}}570 571 g3<void>();572 // expected-error@-1 {{no matching function for call to 'g3'}} \573 // expected-note@#cand6 {{candidate template ignored: constraints not satisfied [with T = void]}} \574 // expected-note@#cand6 {{because 'void' does not satisfy 'C3'}} \575 // expected-note@#concept6 {{because 'std::is_constructible_v<void>' evaluated to false}} \576 // expected-note@#concept6 {{because it is a cv void type}}577 578 f5<void>();579 // expected-error@-1 {{no matching function for call to 'f5'}} \580 // expected-note@#cand9 {{candidate template ignored: constraints not satisfied [with T = void]}} \581 // expected-note-re@#cand9 {{because '{{.*}}is_aggregate<void>::value' evaluated to false}} \582 // expected-note@#cand9 {{'void' is not aggregate}} \583 // expected-note@#cand9 {{because it is a cv void type}}584 585 g5<void>();586 // expected-error@-1 {{no matching function for call to 'g5'}} \587 // expected-note@#cand10 {{candidate template ignored: constraints not satisfied [with T = void]}} \588 // expected-note@#cand10 {{because 'void' does not satisfy 'C5'}} \589 // expected-note@#concept10 {{because 'std::is_aggregate_v<void>' evaluated to false}} \590 // expected-note@#concept10 {{'void' is not aggregate}} \591 // expected-note@#concept10 {{because it is a cv void type}}592}593}594 595 596namespace std {597template <typename T>598struct is_replaceable {599 static constexpr bool value = __builtin_is_replaceable(T);600};601 602template <typename T>603constexpr bool is_replaceable_v = __builtin_is_replaceable(T);604 605}606 607static_assert(std::is_replaceable<int&>::value);608// expected-error@-1 {{static assertion failed due to requirement 'std::is_replaceable<int &>::value'}} \609// expected-note@-1 {{'int &' is not replaceable}} \610// expected-note@-1 {{because it is a reference type}}611static_assert(std::is_replaceable_v<int&>);612// expected-error@-1 {{static assertion failed due to requirement 'std::is_replaceable_v<int &>'}} \613// expected-note@-1 {{'int &' is not replaceable}} \614// expected-note@-1 {{because it is a reference type}}615