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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 35CCD3898527 for ; Mon, 9 Aug 2021 19:47:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 35CCD3898527 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-nWsbW0v5O2SDIDTKZ8nv7Q-1; Mon, 09 Aug 2021 15:47:42 -0400 X-MC-Unique: nWsbW0v5O2SDIDTKZ8nv7Q-1 Received: by mail-wm1-f70.google.com with SMTP id 21-20020a05600c0255b02902571fa93802so170104wmj.1 for ; Mon, 09 Aug 2021 12:47:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DM3h/nAGV1JHOS4Tv/s2aYibkin8SEJZswXVbjRT98Y=; b=RX4fIw6vha8j7JhI08Vwklv3ydITWETldaH825b1kxpwLbIFiqX2gp96kUCsGIT3gF /afQbE3F3QXHeeQYsFGoGEY4qup+O6Un/QCW99P/kgZvjFrL+Mbzl7d/Zov06ngfsfSI 1YbgUXwLx2DdK8V8HN6eDbmIS4Oqwu0boWPHcQb1tzQyMlF7or+Dms9Dv3M7x7gaTTn4 F6iFKMjfxYsp9zCCBBnBw0sWLSZ52DWriiS2BK3vGF/DYaNAn8PfioyPVMEMZ67why4k oFENYSAuOthIJlsKc4rLy3UaFdnyqv2euvuT47bb74VWONmEy4XnbDuVt0DHqXnN/dwO aR9Q== X-Gm-Message-State: AOAM533TN3ry0en2s5RS3DOC+hc4UzXuvhHHu3NGyPKK89wKFvEYvNrm QqYGidnh2xFLFQ+2mck+/2OLH9zjvv7y5hRX7ueeeznUKE744j8q5+k8+d32vwcD7125JjHcZh7 t7aJuFre9Rx7IGW1A2BppT55yfbBzG5lT1A== X-Received: by 2002:a1c:7c10:: with SMTP id x16mr18455990wmc.41.1628538461317; Mon, 09 Aug 2021 12:47:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHtIskcPJiZDP5fCORY/auz4z+6J8Ikdrx7yetWy5ghEwP5pvGGsKb8arN6dCE35CFoi3DDByvyG0+DlzXT98= X-Received: by 2002:a1c:7c10:: with SMTP id x16mr18455969wmc.41.1628538460995; Mon, 09 Aug 2021 12:47:40 -0700 (PDT) MIME-Version: 1.0 References: <7f94ec40-6cec-59c1-2281-066e1a15c267@redhat.com> <5ecf624e-a191-0cd2-19bb-cae92a88cdbf@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Mon, 9 Aug 2021 20:47:30 +0100 Message-ID: Subject: Re: trunk -D_GLIBCXX_DEBUG #include fails To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc Patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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, 09 Aug 2021 19:47:57 -0000 On Mon, 9 Aug 2021 at 15:42, Jonathan Wakely wrote: > > On Mon, 9 Aug 2021 at 15:27, Jonathan Wakely wrote: > > > > On Mon, 9 Aug 2021 at 13:05, Fran=C3=A7ois Dumont via Libstdc++ > > wrote: > > > > > > On 09/08/21 12:05 pm, Jonathan Wakely via Libstdc++ wrote: > > > > On Mon, 9 Aug 2021 at 10:51, Stephan Bergmann via Libstdc++ > > > > wrote: > > > >> Not sure why I started to experience this now with a recent > > > >> GCC/libstdc++ trunk build: > > > >> > > > >>> $ cat test.cc > > > >>> #include > > > >>> $ gcc/trunk/inst/bin/g++ -D_GLIBCXX_DEBUG -fsyntax-only test.cc > > > >>> In file included from /home/sbergman/gcc/trunk/inst/include/c++/1= 2.0.0/bits/regex_automaton.h:401, > > > >>> from /home/sbergman/gcc/trunk/inst/include/c++/= 12.0.0/regex:60, > > > >>> from test.cc:1: > > > >>> /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_autom= aton.tcc: In member function =E2=80=98std::__detail::_StateSeq<_TraitsT> st= d::__detail::_StateSeq<_TraitsT>::_M_clone()=E2=80=99: > > > >>> /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_autom= aton.tcc:197:12: error: =E2=80=98map=E2=80=99 is not a member of =E2=80=98s= td=E2=80=99 > > > >>> 197 | std::map<_StateIdT, _StateIdT> __m; > > > >>> | ^~~ > > > >> [...] > > > >>> In file included from /home/sbergman/gcc/trunk/inst/include/c++/1= 2.0.0/regex:62, > > > >>> from test.cc:1: > > > >>> /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_compi= ler.h: At global scope: > > > >>> /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_compi= ler.h:541:12: error: =E2=80=98vector=E2=80=99 in namespace =E2=80=98std=E2= =80=99 does not name a template type > > > >>> 541 | std::vector<_CharT> _M_char_= set; > > > >>> | ^~~~~~ > > > >> [...] > > > >> > > > >> where neither the use of std::map in bits/regex_automaton.tcc nor = the > > > >> use of std::vector in bits/regex_compiler.h are in _GLIBCXX_DEBUG-= only > > > >> code (but compiling without -D_GLIBCXX_DEBUG succeeded). > > > > With that flag the container implementations are defined in namespa= ce > > > > __gnu_cxx1998, and std::map is supposed to refer to __gnu_debug::ma= p. > > > > But the debug map is declared in a header which isn't included by > > > > since I replaced with . > > > > > > > > > > > > > > > >> Anyway, what would apparently fix it for me is > > > >> > > > >>> diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/includ= e/std/regex > > > >>> index 04fb8b2d971..29fd2956fd0 100644 > > > >>> --- a/libstdc++-v3/include/std/regex > > > >>> +++ b/libstdc++-v3/include/std/regex > > > >>> @@ -42,6 +42,11 @@ > > > >>> #include > > > >>> #include > > > >>> > > > >>> +#if defined _GLIBCXX_DEBUG > > > >>> +#include > > > >>> +#include > > > >>> +#endif > > > >>> + > > > > I think we can do this instead: > > > > > > > > --- a/libstdc++-v3/include/std/regex > > > > +++ b/libstdc++-v3/include/std/regex > > > > @@ -63,6 +63,11 @@ > > > > #include > > > > #include > > > > > > > > +#ifdef _GLIBCXX_DEBUG > > > > +# include > > > > +# include > > > > +#endif > > > > + > > > > #if __cplusplus >=3D 201703L && _GLIBCXX_USE_CXX11_ABI > > > > namespace std _GLIBCXX_VISIBILITY(default) > > > > { > > > > > > > > > > > > I'll test it, thanks for the report. > > > > > > > We are confident about the usage of those containers in the regex > > > implementation, aren't we ? > > > > > > You can normally avoid the includes if you use for example > > > _GLIBCXX_STD_C::map rather than std::map. > > > > Yes, I have a patch to do that. > > This is what I'm testing. Pushed to trunk now.