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 D6E1C3857B8D for ; Fri, 23 Sep 2022 15:04:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D6E1C3857B8D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663945492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xUaFX1SJQHfM24PV3cxX36dvxTC0Mb+6IcYMCZV8rbY=; b=gkW+HcrSzABWX7NMUMkTb7hFpTLQrzp+7EEpj2T6/wXbUWZEhCp1Ns5+9KRKbwCKBSwgQB rxYXw6dnr4qrU4id3J4fzG6YdTj6jsae137JhrzOf/HY52zfpt7n/g6uXIQBeSk5AtFRwJ MYSii7+XAN2ZAwxACsPIp1aiHSnAQPY= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-135-RLJ6MfKaNcypwvocpsSApw-1; Fri, 23 Sep 2022 11:04:51 -0400 X-MC-Unique: RLJ6MfKaNcypwvocpsSApw-1 Received: by mail-qt1-f200.google.com with SMTP id fz10-20020a05622a5a8a00b0035ce18717daso137968qtb.11 for ; Fri, 23 Sep 2022 08:04:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=xUaFX1SJQHfM24PV3cxX36dvxTC0Mb+6IcYMCZV8rbY=; b=MDrJ+xcxjXKjjtV0N2igvJ8A7qsyR4iHz2snul5BtIiODAbJhBZUaAVaI7XU7l+Agk H24n1T22QMrJbMU1HMdSjxKUk6Zht42xueP7FNFcvIdVlAQwaHdGCvBnT/fsc4K/TZlT TIFTwGBfBeAA5DjXtHei5cG5qLQ05cQWx3XUmRrcUmlCDQSzJLqiQ5rIcjbZi8QhUVfi Q5R7HXymQqKHg4FbrhSC9OIZd/8JVKSKISVxo7XyuSRgGUPozJX9tV/gwDoPO2UpeYLv dzY4PqvUZXFhswDpAA4i/qf2wUPbLgGDWiY8gSV7Fi2P7RqD0T8Xk+EGA+pWt+Dhj5EG TuTQ== X-Gm-Message-State: ACrzQf2UvDvSUbAOls9QIq28zJvky0AcXX0v6cOWADTbxNvqX8bbfnfS 4AQgqqeSigbjqduvUYO1xMv+Nyz9zOcFzrJtkkwNEW7IP49RbuoJ5rxaojcfDMgEtQ9zWFad06S ccIdyXxYO1t6hTKQ= X-Received: by 2002:a0c:b3db:0:b0:4ad:8dff:399b with SMTP id b27-20020a0cb3db000000b004ad8dff399bmr4716490qvf.4.1663945487762; Fri, 23 Sep 2022 08:04:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6E1wShvB3zDPlmwW10K5kepcYw7KnEqshfiYyjsqAnZJbo8C49/aYg7yuj73z+9L6nfSzIdA== X-Received: by 2002:a0c:b3db:0:b0:4ad:8dff:399b with SMTP id b27-20020a0cb3db000000b004ad8dff399bmr4715757qvf.4.1663945479604; Fri, 23 Sep 2022 08:04:39 -0700 (PDT) Received: from redhat.com (2603-7000-9500-2e39-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:2e39::1db4]) by smtp.gmail.com with ESMTPSA id e24-20020ac84918000000b003445d06a622sm5273697qtq.86.2022.09.23.08.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:04:39 -0700 (PDT) Date: Fri, 23 Sep 2022 11:04:37 -0400 From: Marek Polacek To: Jonathan Wakely Cc: Jason Merrill , GCC Patches , libstdc++ Subject: Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784] Message-ID: References: <20220922133900.142238-1-polacek@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.7 (2022-08-07) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP 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: On Fri, Sep 23, 2022 at 03:40:23PM +0100, Jonathan Wakely wrote: > On Thu, 22 Sept 2022 at 23:14, Jason Merrill wrote: > > On 9/22/22 09:39, Marek Polacek wrote: > > > This patch doesn't make libstdc++ use the new built-ins, but I had to > > > rename a class otherwise its name would clash with the new built-in. > > > > Sigh, that's going to be a hassle when comparing compiler versions on > > preprocessed code. > > Good point. Clang has some gross hacks that we could consider. When it > sees a declaration that uses a built-in name, it disables the built-in > for the remainder of the translation unit. It does this precisely to > allow a new Clang to compile old std::lib headers where a built-in > like __is_assignable was used as a normal class template, not the > built-in (because no such built-in existed at the time the library > code was written). For us, this is only really a problem when > bisecting bugs and using a newer compiler to compile .ii files from > odler headers, but for Clang combining a new Clang with older > libstdc++ headers is a hard requirement (recall that when Clang was > first deployed to macOS it had to consume the system's libstdc++ 4.2 > headers). > > It's a big kluge, but it would mean that a new GCC could happily > consume preprocessed code from older libstdc++ headers. Ah, you're right, it must be this lib/Parse/ParseDeclCXX.cpp code: // GNU libstdc++ 4.2 and libc++ use certain intrinsic names as the // name of struct templates, but some are keywords in GCC >= 4.3 // and Clang. Therefore, when we see the token sequence "struct // X", make X into a normal identifier rather than a keyword, to // allow libstdc++ 4.2 and libc++ to work properly. TryKeywordIdentFallback(true); Whether we want to do this, I'm not sure. Marek