public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98752] New: wrong "error: ‘this’ is not a constant expression" with consteval constructor
@ 2021-01-19 19:59 sbergman at redhat dot com
  2021-01-19 20:20 ` [Bug c++/98752] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: sbergman at redhat dot com @ 2021-01-19 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98752
           Summary: wrong "error: ‘this’ is not a constant expression"
                    with consteval constructor
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

At least with gcc-c++-10.2.1-9.fc33.x86_64 and with a local GCC 11 trunk build:

> $ cat test.cc
> struct S1 { consteval S1(int) {} };
> struct S2 {
>   S1 x;
>   S2(): x(0) {}
> };

> $ g++ -std=c++20 -fsyntax-only test.cc
> test.cc: In constructor ‘S2::S2()’:
> test.cc:4:12: error: ‘this’ is not a constant expression
>     4 |   S2(): x(0) {}
>       |            ^

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

end of thread, other threads:[~2024-02-16 16:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 19:59 [Bug c++/98752] New: wrong "error: ‘this’ is not a constant expression" with consteval constructor sbergman at redhat dot com
2021-01-19 20:20 ` [Bug c++/98752] " mpolacek at gcc dot gnu.org
2021-01-19 20:31 ` jakub at gcc dot gnu.org
2021-01-19 20:37 ` mpolacek at gcc dot gnu.org
2021-01-20  9:25 ` jakub at gcc dot gnu.org
2021-12-09  7:47 ` pinskia at gcc dot gnu.org
2023-12-06 19:46 ` sberg.fun at gmail dot com
2024-02-16 16:39 ` mpolacek 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).