public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/96994] Missing code from consteval constructor initializing const variable
Date: Thu, 10 Sep 2020 17:55:12 +0000	[thread overview]
Message-ID: <bug-96994-4-jhtZFrSyU5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96994-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though:
struct A { consteval A (int x) { i = x; } int i = 0; };
struct B { constexpr B (int x) { i = x; } int i = 0; };
A const a = 1;
constexpr A b = 2;
B const c = 3;
A constinit d = 4;
static_assert (b.i == 2);

int
main()
{
  if (a.i != 1 || c.i != 3 || d.i != 4)
    __builtin_abort ();
}
works fine, so the problem is maybe just with default construction for
consteval ctor.

  parent reply	other threads:[~2020-09-10 17:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 11:27 [Bug c++/96994] New: " sbergman at redhat dot com
2020-09-09 22:06 ` [Bug c++/96994] " mpolacek at gcc dot gnu.org
2020-09-10 17:52 ` jakub at gcc dot gnu.org
2020-09-10 17:55 ` jakub at gcc dot gnu.org [this message]
2020-09-10 18:00 ` mpolacek at gcc dot gnu.org
2020-09-10 18:10 ` jakub at gcc dot gnu.org
2020-09-10 18:11 ` jakub at gcc dot gnu.org
2020-09-14 13:11 ` jakub at gcc dot gnu.org
2020-09-21 20:08 ` mpolacek at gcc dot gnu.org
2020-10-01  9:19 ` cvs-commit at gcc dot gnu.org
2020-10-05  8:25 ` cvs-commit at gcc dot gnu.org
2021-04-20 15:12 ` jakub at gcc dot gnu.org

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-96994-4-jhtZFrSyU5@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).