public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110028] New: slow compilation on incorrect namespace after gcc-12.1
@ 2023-05-29 21:20 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
  0 siblings, 2 replies; 3+ messages in thread
From: stevenxia990430 at gmail dot com @ 2023-05-29 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110028
           Summary: slow compilation on incorrect namespace after gcc-12.1
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following program is very slow to compile (>10 seconds) and return error.
Compared to clang (<1 second).

To quickly reproduce: https://gcc.godbolt.org/z/Pfrxcdb9h

```
#include <span>
#include <vector>

namespace test
{
#include <algorithm>

std::size_t filter_odd_elements(std::span<long> array)
{
  std::size_t index = 0;
  std::copy_if(array.rbegin(), array.rend(), array.begin(), [&](long value)
               {
                 return (++index) % 2 == 1; 
               });
  return index;
}
}

int main() {
}

```

Tested on Trunk and it seems that the slow compilation rate occured after and
including gcc 12.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-30 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-29 21:20 [Bug c++/110028] New: slow compilation on incorrect namespace after gcc-12.1 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 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).