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.133.124]) by sourceware.org (Postfix) with ESMTPS id 8AB9E3858D3C for ; Mon, 2 May 2022 05:12:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8AB9E3858D3C Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-7voz6wnVNbCKnyu48P_QxA-1; Mon, 02 May 2022 01:11:58 -0400 X-MC-Unique: 7voz6wnVNbCKnyu48P_QxA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E42D811E75; Mon, 2 May 2022 05:11:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 497F514A5697; Mon, 2 May 2022 05:11:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 2425BtLB3996046 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 2 May 2022 07:11:56 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 2425BsWd3996045; Mon, 2 May 2022 07:11:54 +0200 Date: Mon, 2 May 2022 07:11:54 +0200 From: Jakub Jelinek To: Richard Biener , Jonathan Wakely Cc: gcc-patches@gcc.gnu.org, Iain Sandoe Subject: [committed] system.h: Include in system.h unconditionally Message-ID: Reply-To: Jakub Jelinek References: <92C6EA36-CA62-4E3E-B7B5-5E1C06A44E70@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.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, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 05:12:01 -0000 On Sun, May 01, 2022 at 07:06:53PM +0100, Jonathan Wakely wrote: > > >> the reason is that "gcc/analyzer/region-model.cc” uses initializer_lists, and it seems that > > >> is not transitively included by any used headers for _LIBCPP_VERSION < 4000. I fixed that locally by > > >> adding initializer_list into system.h (and adding INCLUDE_INITIALIZER_LIST to the top of gcc/analyzer/region-model.cc) > > >> - with that change those versions do bootstrap and test OK*** > > > > > > From what I can see, with libstdc++ it works because which is > > > included by system.h includes . > > > If I rename initializer_list in analyzer/region-model.ii to initializer_listx, I > > > also get: > > > ../../gcc/analyzer/region-model.cc: In function ‘void ana::selftest::test_binop_svalue_folding()’: > > > ../../gcc/analyzer/region-model.cc:4966:48: error: deducing from brace-enclosed initializer list requires ‘#include ’ > > > 4508 | > > > +++ |+#include > > > 4509 | static void > > > ...... > > > 4966 | for (auto op : {BIT_IOR_EXPR, TRUTH_OR_EXPR}) > > > | ^ > > > ../../gcc/analyzer/region-model.cc:4978:49: error: deducing from brace-enclosed initializer list requires ‘#include ’ > > > 4978 | for (auto op : {BIT_AND_EXPR, TRUTH_AND_EXPR}) > > > | ^ > > > > > > I think we have 2 options, one is do what you wrote above, > > > INCLUDE_INITIALIZER_LIST defined before system.h to get #include . > > > The other option is just to include that unconditionally, it is a very small > > > header. For libstdc++ it will make no difference as it is included anyway > > > and the header is really small there, libc++ includes which isn't > > > normally included and system.h includes instead. > > > > I’d say unconditionally would be OK. I suppose the chance that any host > > C++ is good enough to build GCC as-is but fails to provide > > is zero? > > > > Yes, definitely. > > > I’d be OK to do this change without a new RC even. I've bootstrapped/regtested this on 12 branch on x86_64-linux and i686-linux, committed to both. 2022-05-02 Jakub Jelinek * system.h: Include initializer_list. --- gcc/system.h.jj 2022-04-28 15:56:06.786792094 +0200 +++ gcc/system.h 2022-05-01 20:23:04.373273340 +0200 @@ -239,6 +239,7 @@ extern int errno; # include #endif # include +# include # include # include # include Jakub