public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/110028] slow compilation on incorrect namespace after gcc-12.1
Date: Tue, 30 May 2023 10:20:45 +0000	[thread overview]
Message-ID: <bug-110028-4-FVQR3PMQHg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110028-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110028

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-05-30
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Steven Xia from comment #0)
> The following program is very slow to compile (>10 seconds) and return
> error. Compared to clang (<1 second).

N.B. -std=c++20 or similar is needed to reproduce this. It's fast with the
default options.

It's fast with -fmax-errors=2000 so I think the error handling machinery gets
stuck in a loop, or the time is spent generating the actual error output.

Maybe we should instantly fail if any libstdc++ header is included inside a
namespace, since that's explicitly disallowed by the standard:

"A translation unit shall include a header only outside of any declaration or
definition and, in the case of a module unit, only in its
global-module-fragment, and shall include the header or import the
corresponding header unit lexically before the first reference in that
translation unit to any of the entities declared in that header. No diagnostic
is required."

That would need some new attribute or pragma though.

      parent reply	other threads:[~2023-05-30 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 21:20 [Bug c++/110028] New: " stevenxia990430 at gmail dot com
2023-05-30  4:24 ` [Bug c++/110028] " pinskia at gcc dot gnu.org
2023-05-30 10:20 ` redi at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110028-4-FVQR3PMQHg@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).