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 ESMTP id 2785E385481D for ; Mon, 9 Aug 2021 19:47:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2785E385481D Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-sAnTDAqqNx-DUOR8_blvhw-1; Mon, 09 Aug 2021 15:47:42 -0400 X-MC-Unique: sAnTDAqqNx-DUOR8_blvhw-1 Received: by mail-wr1-f69.google.com with SMTP id p12-20020a5d68cc0000b02901426384855aso5619638wrw.11 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=Ys234JUHcsT1aM4IP0OvHI0Cvlgrdjwk1H/6gmNmjDLJDZpynzo60l6K0iDPWxeoAT z0U1Y9H0JEBHdTBFqigj1wMvsRi5S2uDXOv2SHWKSLHIomvV8ZBHvAfrbGXd9SUZgdEz UTgoKjdl5W7Zn2zJtRvuWEGqtM40YyAV6h6YSK9nQr30thbWGIGipFktQxAb1I3mp2eJ aEJ8MsXkvfZ2GdPfQD5VF5ax8Ab27GXHYeZbESEoM06pqAfgCNzHNEANo07rX3WOJYMH u0DnlZBPp1FZ7tVtgQOQ/eMjTt1XFeXi/FaAkWthxd5XrB+XAe28y8d6aweWcA18MOiD Vbdw== X-Gm-Message-State: AOAM531EanEpuQ2T01vDyu5sT0n/+6kAXU32JNxw0ZYjEu+kkN+7SQtq fv4EygrLskYgCLFMy74cHL1ZjeuSKbCvfKhgP1hnwcpbTDSt69QtchdcWhBw7omMXOUiDauC8KB wE08jd5OB3FP2IhgkS6tsOF0BWRQurME= X-Received: by 2002:a1c:7c10:: with SMTP id x16mr18455978wmc.41.1628538461190; 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.1 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: 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: 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.