From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 850193858004; Fri, 26 Aug 2022 08:02:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 850193858004 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52a.google.com with SMTP id u6so1117606eda.12; Fri, 26 Aug 2022 01:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=qGVPqZV9syuST8KWkGRmmTv+iE6jcUpJz8M32oG2KU0=; b=V/r352Tg/ngGWc8WAtotIMsj8sBznkujDTjNt9OeIScneD3UaHEMO0Cq+klyp25AoB fGUT6nX6a8a+HjQhHyG+wj0qtX4izadXl5yZjWinelTFKm4hEJT3n1oZgQoAW4MtInO8 eLrnluRJepQGjYXqUgPF0HGUJ6qdraUIo1ewfdNqw7dkZ3/Re0l3wZRyowZiJKXl9b/J IxtVit6SMU0FfPXhYEjWvXRfbzJa64+5ufWPuvlJRTh/Ym2sh5GetPmmiRSNBII2+xRC ZCfbo7NQxbxeGidYSgpVCAaF38WhlgbU6s4o9LfTCKqNeBqpTyNo721JFKdKoPVERwkh 0qjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=qGVPqZV9syuST8KWkGRmmTv+iE6jcUpJz8M32oG2KU0=; b=KOp3m8HgVgqX6G579eS1PgXH2CJ5wo4ZFeYzqKyzsCPtRJD/mq20+BcXkHO/1W048g WRcB2Ax4kv/cU5d87bmUUvpDBTQ1uOPpfBCN4kd1CwbnSEa8AxekqhFMhoxQ6757POCA +jywnqAwqcRF+XLtaorzM+HWxYUgDVaeGo42rTaKgs+D93gbmljnuVAqjBbJmr285gYE Kyg8AGhNZC2jEPc0W3g7k1XFFd1nL5g6Px07/MW4mmUXihegDi93WymkgoXFrlCQFGCg IdAMa+05K/JjFl3pKNQU4ZrceXdohlLFEX+ARQ8aUD9LHqL/ZAhIzLAum/e51EYwH+5q e4Vg== X-Gm-Message-State: ACgBeo03LGE0/KVzkm6L/v0SN2jdTlqVB/rrjhMHN4JrajbBS9DR3jFU aJjCJxFGhFowDIP2JrS1KBpOaQxN+MBz/vnjnfU= X-Google-Smtp-Source: AA6agR7sDYCZD/PaA/DPToZiuJJxc48bHqHnlQvnVodYLAurvzMmWRJ15i0ou6rNX2lEor7F2Y/nr2twjbCk2ig80kk= X-Received: by 2002:a05:6402:3590:b0:447:a871:c48a with SMTP id y16-20020a056402359000b00447a871c48amr5796934edc.356.1661500931075; Fri, 26 Aug 2022 01:02:11 -0700 (PDT) MIME-Version: 1.0 References: <20220826010428.2272001-1-ppalka@redhat.com> In-Reply-To: <20220826010428.2272001-1-ppalka@redhat.com> From: Jonathan Wakely Date: Fri, 26 Aug 2022 09:01:57 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Add test for std::con/disjunction's base class To: Patrick Palka Cc: gcc-patches , "libstdc++" Content-Type: multipart/alternative; boundary="000000000000ca719a05e7205470" X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20220826080157.mfvXqAvDE_YetvUlMopsttiWhN0o0lvNVVblM2Yl6Cg@z> --000000000000ca719a05e7205470 Content-Type: text/plain; charset="UTF-8" On Fri, 26 Aug 2022, 02:06 Patrick Palka via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > libstdc++-v3/ChangeLog: > > * testsuite/20_util/logical_traits/requirements/base_classes.cc: > New test. > --- > .../requirements/base_classes.cc | 37 +++++++++++++++++++ > 1 file changed, 37 insertions(+) > create mode 100644 > libstdc++-v3/testsuite/20_util/logical_traits/requirements/base_classes.cc > > diff --git > a/libstdc++-v3/testsuite/20_util/logical_traits/requirements/base_classes.cc > b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/base_classes.cc > new file mode 100644 > index 00000000000..6699037bb14 > --- /dev/null > +++ > b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/base_classes.cc > @@ -0,0 +1,37 @@ > +// { dg-do compile { target c++17 } } > + > +#include > instead OK with that change, thanks. + > +using std::true_type; > +using std::false_type; > + > +template struct T : std::true_type { }; > +template struct F : std::false_type { }; > + > +// [meta.logical]/5: The specialization conjunction has a > +// public and unambiguous base that is either: > +// - the first type B_i in the list true_type, B_1, ..., B_n for which > +// bool(B_i::value) is false, or > +// - if there is no such Bi, the last type in the list. > + > +static_assert(std::is_base_of_v>); > +static_assert(std::is_base_of_v, std::conjunction>>); > +static_assert(std::is_base_of_v, std::conjunction>>); > +static_assert(std::is_base_of_v, std::conjunction, T<1>>>); > +static_assert(std::is_base_of_v, std::conjunction, F<1>>>); > +static_assert(std::is_base_of_v, std::conjunction, F<0>, > F<1>>>); > +static_assert(std::is_base_of_v, std::conjunction, F<0>, T<1>, > F<1>>>); > + > +// [meta.logical]/10: The specialization disjunction has a > +// public and unambiguous base that is either: > +// - the first type B_i in the list false_type, B_1, ..., B_n for which > +// bool(B_i::value) is true, or > +// - if there is no such Bi, the last type in the list. > + > +static_assert(std::is_base_of_v>); > +static_assert(std::is_base_of_v, std::disjunction>>); > +static_assert(std::is_base_of_v, std::disjunction>>); > +static_assert(std::is_base_of_v, std::disjunction, T<1>>>); > +static_assert(std::is_base_of_v, std::disjunction, F<1>>>); > +static_assert(std::is_base_of_v, std::disjunction, F<0>, > F<1>>>); > +static_assert(std::is_base_of_v, std::disjunction, F<0>, T<1>, > F<1>>>); > -- > 2.37.2.382.g795ea8776b > > --000000000000ca719a05e7205470--