public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/108309] [12 Regression] ICE in in cxx_eval_component_reference, at cp/constexpr.cc:4136
Date: Fri, 06 Jan 2023 06:22:10 +0000	[thread overview]
Message-ID: <bug-108309-4-deAZ6BHKIE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108309-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.3
           Keywords|                            |ice-on-valid-code,
                   |                            |needs-bisection
      Known to fail|                            |12.2.0
            Summary|ICE in in                   |[12 Regression] ICE in in
                   |cxx_eval_component_referenc |cxx_eval_component_referenc
                   |e, at cp/constexpr.cc:4136  |e, at cp/constexpr.cc:4136
      Known to work|                            |11.3.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-01-06

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced further:
```
struct _Enable_copy_move {};
struct h {
  union {
    int _M_value;
  };
};
struct m {
  constexpr m(...) : _M_payload() {}
  constexpr m(const m &) {}
  h _M_payload;
};
struct optional : m, _Enable_copy_move {
  constexpr optional() {}
  template <typename _Up> constexpr optional(_Up __t) : m(__t) {}
};
struct array { optional t[1]; };

optional page {
  array {}
};

```

>clang++-15 doesn't (not sure if it's related, but i thought it's worth mentioning:

That is a conditionally supported construct in C++. clang does not support it
but GCC does. 

GCC does warn with -Wconditionally-supported :

<source>: In instantiation of 'constexpr optional::optional(_Up) [with _Up =
array]':
<source>:20:1:   required from here
<source>:14:62: warning: passing objects of non-trivially-copyable type 'struct
array' through '...' is conditionally supported [-Wconditionally-supported]
   14 |   template <typename _Up> constexpr optional(_Up __t) : m(__t) {}
      |                                                              ^


Anyways this is fixed on the trunk; though since it is a GCC 12.x regression it
will/should be fixed on the GCC 12 branch too once someone figures out which
patch fixed it.

  parent reply	other threads:[~2023-01-06  6:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  3:09 [Bug c++/108309] New: " tim at klingt dot org
2023-01-06  3:09 ` [Bug c++/108309] " tim at klingt dot org
2023-01-06  6:22 ` pinskia at gcc dot gnu.org [this message]
2023-01-06  6:31 ` [Bug c++/108309] [12 Regression] " tim at klingt dot org
2023-01-06  6:33 ` pinskia at gcc dot gnu.org
2023-01-06 11:30 ` marxin at gcc dot gnu.org
2023-01-06 17:25 ` pinskia at gcc dot gnu.org
2023-04-27 12:06 ` rguenth at gcc dot gnu.org
2023-05-08 12:26 ` rguenth 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-108309-4-deAZ6BHKIE@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).