public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108158] New: modification of '...' is not a constant expression
@ 2022-12-17 21:00 serge.guelton@telecom-bretagne.eu
  2022-12-17 21:35 ` [Bug c++/108158] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: serge.guelton@telecom-bretagne.eu @ 2022-12-17 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108158
           Summary: modification of '...' is not a constant expression
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: serge.guelton@telecom-bretagne.eu
  Target Milestone: ---

Since version 11.3, gcc fails on compiling a (complex) constant expression from
the frozen[0] library. gcc 11.2 is fine, and so are clang and msvc.

I've reduced the code to the following: https://godbolt.org/z/e5bje7v35
It's still a relatively large piece of code, I failed to reduce it more
significantly, sorry about that. The error message is

```
<source>:458:39:   in 'constexpr' expansion of
'ze_set.frozen::unordered_set<short unsigned int, 3>::lookup<int,
frozen::elsa<short unsigned int> >(4, frozen::elsa<short unsigned int>())'
<source>:453:32:   in 'constexpr' expansion of '((const
frozen::unordered_set<short unsigned int,
3>*)this)->frozen::unordered_set<short unsigned int,
3>::tables_.frozen::bits::pmh_tables<8, frozen::elsa<short unsigned int>
>::lookup<int, frozen::elsa<short unsigned int> >((* & key), (* & hash))'
<source>:458:67:   in 'constexpr' expansion of 'frozen::bits::seed_or_index()'
<source>:458:67: error: modification of 'ze_set' is not a constant expression
  458 | constexpr auto nocount = ze_set.lookup(4, frozen::elsa<uint16_t>());
      | 
```

But I don't see where such a modification would happen, and the fact that older
version of gcc and clang and msvc correctly evaluate that expression makes me
think it could be a GCC bug. Maybe bisecting between 11.2 and 11.3 would help
understanding the origin of the regression?


[0] https://github.com/serge-sans-paille/frozen

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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17 21:00 [Bug c++/108158] New: modification of '...' is not a constant expression serge.guelton@telecom-bretagne.eu
2022-12-17 21:35 ` [Bug c++/108158] " pinskia at gcc dot gnu.org
2022-12-17 21:36 ` [Bug c++/108158] [11/12/13 Regression] " pinskia at gcc dot gnu.org
2022-12-20 16:58 ` [Bug c++/108158] [11/12/13 Regression] modification of '...' is not a constant expression since r12-2304 jakub at gcc dot gnu.org
2022-12-20 17:12 ` mpolacek at gcc dot gnu.org
2022-12-20 17:13 ` mpolacek at gcc dot gnu.org
2022-12-27 15:02 ` marxin at gcc dot gnu.org
2023-01-27 23:17 ` mpolacek at gcc dot gnu.org
2023-02-03 18:58 ` cvs-commit at gcc dot gnu.org
2023-02-03 18:59 ` [Bug c++/108158] [11/12 " mpolacek at gcc dot gnu.org
2023-05-29 10:07 ` jakub 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).