From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AC1C0385781E for ; Sun, 17 Jul 2022 21:12:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC1C0385781E Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-275-XSeV98sxPfavM4pH6xYB-Q-1; Sun, 17 Jul 2022 17:12:46 -0400 X-MC-Unique: XSeV98sxPfavM4pH6xYB-Q-1 Received: by mail-ed1-f70.google.com with SMTP id o13-20020a056402438d00b0043aa846b2d2so6741560edc.8 for ; Sun, 17 Jul 2022 14:12:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0QoLN+3IQ+A37AMxDs1xUj7sI6RjX4c/FaHSDnWG53I=; b=tSDupzf7ouRLzRlPezeWbGtc1pmM65y5F8Y6OWcwhdpVuP+YMZ+XlKjfs8nGvrE2m5 aETXQn6lmbqEJz+SToei62MAReiqTdgW/OZ1xE0GPjwgXISZUNeBnrFBuxxuVgeFfnoN KW8O3kPRuwGe9HLYptFow6rwuAnilOs/pvyUiDL13VSldgQVe1T08sT9QUS4PuLU2794 PrrrMlwqaq8hTLl78tfChnIHaDqkCu0l8mdsvhTPJ0YrbAQs+L8I48Mei7NukOkAJCFe ifuWFFNY0nWvtY3ymcM/CzBKVH5Jk5sn7N65VGziiCDUblUzWzld7KPHl9vvfestItu0 iP8Q== X-Gm-Message-State: AJIora/GXz5ZT6rowTpGU32rPqyDpvnrLrgWUgaZxIQLkCbEdZWVdHJ9 Hn8o0Rd72/1zQFyymvUAi2CVBSoaIcAFmWpiyhq/lJ1zZcqNQ+GJKhKV135QahimI9ymPukkHlf ImHVfTEhkX6XlyHw= X-Received: by 2002:aa7:d759:0:b0:43a:6fe3:acb4 with SMTP id a25-20020aa7d759000000b0043a6fe3acb4mr33599123eds.27.1658092364950; Sun, 17 Jul 2022 14:12:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBRcjKrhGf/Bw0OPAZHT94nZa0EuDB2AN8gwKxuRHOk/ND1DumqItWebGTHij7lN3wfdbfaw== X-Received: by 2002:aa7:d759:0:b0:43a:6fe3:acb4 with SMTP id a25-20020aa7d759000000b0043a6fe3acb4mr33599108eds.27.1658092364667; Sun, 17 Jul 2022 14:12:44 -0700 (PDT) Received: from [192.168.178.55] (98-5-133-N4.customer.vsm.sh. [170.133.5.98]) by smtp.gmail.com with ESMTPSA id ne23-20020a1709077b9700b007263481a43fsm4666945ejc.81.2022.07.17.14.12.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jul 2022 14:12:44 -0700 (PDT) Message-ID: Date: Sun, 17 Jul 2022 23:12:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] c++: Add __reference_con{struc,ver}ts_from_temporary [PR104477] To: Marek Polacek Cc: libstdc++ , GCC Patches References: <20220708174133.2462418-1-polacek@redhat.com> <7955e63f-c20e-482c-cea3-db0942ed0149@redhat.com> <16983f2a-f56a-1462-c2db-3e4bc6fa6ad7@redhat.com> <93e09683-22c9-9e13-9ae1-13c4b447f38f@redhat.com> From: Stephan Bergmann In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2022 21:12:49 -0000 On 7/15/22 22:25, Marek Polacek via Gcc-patches wrote: > Yeah, I guess so. But I've already pushed the patch. This commit obviously breaks using libstdc++ with Clang (in -std=c++2b mode), which doesn't implement those new builtins. Something like the below would fix that, > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index b1a1deecf66..a6e028b42ec 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -3505,6 +3505,7 @@ template > template > inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value; > > +#if __has_builtin(__reference_constructs_from_temporary) && __has_builtin(__reference_converts_from_temporary) > #define __cpp_lib_reference_from_temporary 202202L > > /// True if _Tp is a reference type, a _Up value can be bound to _Tp in > @@ -3544,6 +3545,7 @@ template > template > inline constexpr bool reference_converts_from_temporary_v > = reference_converts_from_temporary<_Tp, _Up>::value; > +#endif > #endif // C++23 > > #if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED > diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version > index 5edca2f3007..7c4b7f7cc6d 100644 > --- a/libstdc++-v3/include/std/version > +++ b/libstdc++-v3/include/std/version > @@ -304,7 +304,9 @@ > #define __cpp_lib_byteswap 202110L > #define __cpp_lib_constexpr_typeinfo 202106L > #define __cpp_lib_is_scoped_enum 202011L > +#if __has_builtin(__reference_constructs_from_temporary) && __has_builtin(__reference_converts_from_temporary) > #define __cpp_lib_reference_from_temporary 202202L > +#endif > > #if _GLIBCXX_HOSTED > #define __cpp_lib_adaptor_iterator_pair_constructor 202106L