brintos

brintos / llvm-project-archived public Read only

0
0
Text · 591 B · 9281279 Raw
34 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s2// expected-no-diagnostics3 4template <bool v>5struct BC {6  static constexpr bool value = v;7};8 9template <typename T, typename Arg>10struct Constructible : BC<__is_constructible(T, Arg)> {};11 12template <typename T>13using Requires = T::value;14 15template <typename T>16struct optional {17  template <typename U, Requires<Constructible<T, U>> = true>18  optional(U) {}19};20 21struct MO {};22struct S : MO {};23struct TB {24  TB(optional<S>) {}25};26 27class TD : TB, MO {28  using TB::TB;29};30 31void foo() {32  static_assert(Constructible<TD, TD>::value);33}34