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 29D87385E036 for ; Mon, 9 Aug 2021 10:05:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29D87385E036 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-M0B0yGdwP-2-iEmUCG-pgA-1; Mon, 09 Aug 2021 06:05:43 -0400 X-MC-Unique: M0B0yGdwP-2-iEmUCG-pgA-1 Received: by mail-wm1-f72.google.com with SMTP id f6-20020a05600c1546b029025af999e04dso3859752wmg.7 for ; Mon, 09 Aug 2021 03:05:43 -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=3KnBT6RFhP4Ajs2LQwpgiPOnaIlkaxWD1FVrwgLSpPU=; b=JWlcXfRT/5aDci/fkM6xSzDLfUBWdCBymhDBvLWmaTgbQvhaWkLEoKErz/XkCsBRq7 8yvd+cxLdaIIpNBpWkskKFEsn6iX6R4/SshQp1g8Bm2ThAhTtseQURb49EbCHo7E7CBm JKVTA0cdeRYWkj+sji+o9BeNRYbAsZ2SxCp6odi4T8sD9Lw+GC8l25li9csK0mmmUitB 1lsdDv31xOvFJwvRFhl3zkqGnIz1gnbXgq5EGF7Mv7nOEYaC4BSlh3k3Hbp+1t8pj3oM 3OBrWl2LfpOfv2lW1eB8/fTWbNti2ne6eN3uT2NVP0k83cOyqy7lQiwjUo95tRWqBWHf Uedw== X-Gm-Message-State: AOAM533ik+2pNfMvKGrppYKQ7YdsxMsEFH3NPH0VDx59SwPGj/kWEtuw d+tbW6xotlMsSn7nFkKqKUqj+ZqgAELboUWmhz5OgjLFf3sWB+e8sZ4F5KUMYiuvLCdXd4DziZl e9BDAzHNgU80t7E8LdWR3S++eP+RQJz0= X-Received: by 2002:adf:dfc2:: with SMTP id q2mr24615757wrn.13.1628503542587; Mon, 09 Aug 2021 03:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgrkIxzHKEVFzM2qkwHpZmm8EiqBUMjcKZ/RcwBXazvmNyHtYzSYQPlKLDV/KUxf4Txf6wqy2d44PtP73P9z0= X-Received: by 2002:adf:dfc2:: with SMTP id q2mr24615733wrn.13.1628503542338; Mon, 09 Aug 2021 03:05:42 -0700 (PDT) MIME-Version: 1.0 References: <7f94ec40-6cec-59c1-2281-066e1a15c267@redhat.com> In-Reply-To: <7f94ec40-6cec-59c1-2281-066e1a15c267@redhat.com> From: Jonathan Wakely Date: Mon, 9 Aug 2021 11:05:31 +0100 Message-ID: Subject: Re: trunk -D_GLIBCXX_DEBUG #include fails To: Stephan Bergmann 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=-12.8 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 10:05:46 -0000 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++/12.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_automaton.t= cc: In member function =E2=80=98std::__detail::_StateSeq<_TraitsT> std::__d= etail::_StateSeq<_TraitsT>::_M_clone()=E2=80=99: > > /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_automaton.t= cc:197:12: error: =E2=80=98map=E2=80=99 is not a member of =E2=80=98std=E2= =80=99 > > 197 | std::map<_StateIdT, _StateIdT> __m; > > | ^~~ > [...] > > In file included from /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/= regex:62, > > from test.cc:1: > > /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_compiler.h:= At global scope: > > /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_compiler.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 namespace __gnu_cxx1998, and std::map is supposed to refer to __gnu_debug::map. 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/include/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.