From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 5442E3858418; Sat, 2 Apr 2022 10:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5442E3858418 Received: by mail-wr1-x42f.google.com with SMTP id d7so7484824wrb.7; Sat, 02 Apr 2022 03:46:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8HhKRRetqQBROyT1ICjbGdYS2B0RGgGxvkAl2bDCgBU=; b=BXT55V3i6n+Sy8mv3slMhrA5ZrFSiwCWEgY/ihsXlI6r6R/PviQPpvtHoPF2gpnwDk GCytjQJ31n4C1ThtnMfTimrlM9+Vn6tPcLHyDJmsYpjhtiMHt8IR4SFgK9MHrsIg+guJ Jgmsnmh3+9KSZWNhemzcmpZh4yZUPXN0PflOvSE1+nUWQCDkR2geXJL5+oU89PbLc7Ek jAfWXgrbonTpc6WbAQSrGhfdWM7S9nyzdVZ4SEfXzEX+ayl88tlgfL2K1/lzYxKq9NLn B4CkVxEjxHKgkmcFjjyLI0DgDNNjslXLNMiv8IXpUi3v3MbIICS262M3UBIKdangx+pr PeCg== X-Gm-Message-State: AOAM531SiCWPZr8vHBE/o47+RRem0xUViRcndvrtzHF/hvfHOl4e3nWo lXpfX3Bja9ms1PJz40G5YpcDaw6H2BZ0a2BO5TI= X-Google-Smtp-Source: ABdhPJz+Ay/RK4TOODqVtuiiTHzmLhyt+L4cgzQGhlZRtd3OTKD29Ics7eZuU3wzRa8Lky0hJP2xbaP/30e++oTiJI8= X-Received: by 2002:a05:6000:1888:b0:204:1a8b:2999 with SMTP id a8-20020a056000188800b002041a8b2999mr10884090wri.221.1648896375027; Sat, 02 Apr 2022 03:46:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Sat, 2 Apr 2022 11:46:03 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Tweak source_location for clang trunk [PR105128] To: Jakub Jelinek Cc: Jonathan Wakely , "libstdc++" , gcc-patches X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sat, 02 Apr 2022 10:46:18 -0000 On Sat, 2 Apr 2022, 10:32 Jakub Jelinek via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > Hi! > > Apparently clang trunk implemented __builtin_source_location(), but the > using __builtin_ret_type = decltype(__builtin_source_location()); > which has been added for it isn't enough, they also need the > std::source_location::__impl class to be defined (but incomplete seems > to be good enough) before the builtin is used. > > The following has been tested on godbolt with clang trunk (old version > fails with > error: 'std::source_location::__impl' was not found; it must be defined > before '__builtin_source_location' is called > and some follow-up errors), getting back to just void * instead of > __builtin_ret_type and commenting out using doesn't work either and > just struct __impl; before using __builtin_ret_type doesn't work too. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > OK, thanks. > 2022-04-02 Jakub Jelinek > > PR libstdc++/105128 > * include/std/source_location (std::source_location::__impl): Move > definition before using __builtin_ret_type. > > --- libstdc++-v3/include/std/source_location 2022-02-25 > 10:46:53.275178858 +0100 > +++ libstdc++-v3/include/std/source_location 2022-04-01 > 19:36:02.056236397 +0200 > @@ -43,6 +43,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { > private: > using uint_least32_t = __UINT_LEAST32_TYPE__; > + struct __impl > + { > + const char* _M_file_name; > + const char* _M_function_name; > + unsigned _M_line; > + unsigned _M_column; > + }; > using __builtin_ret_type = decltype(__builtin_source_location()); > > public: > @@ -76,14 +83,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { return _M_impl ? _M_impl->_M_function_name : ""; } > > private: > - struct __impl > - { > - const char* _M_file_name; > - const char* _M_function_name; > - unsigned _M_line; > - unsigned _M_column; > - }; > - > const __impl* _M_impl = nullptr; > }; > > > Jakub > >