public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96064] New: Defaulted constexpr spaceship operator triggers internal compiler error after including utility
@ 2020-07-05  8:06 milasudril at gmail dot com
  2020-07-08 22:04 ` [Bug c++/96064] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: milasudril at gmail dot com @ 2020-07-05  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96064
           Summary: Defaulted constexpr spaceship operator triggers
                    internal compiler error after including utility
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: milasudril at gmail dot com
  Target Milestone: ---

The following code crashes gcc-10.1

#include <utility>

class WrappedValue
{
    public:
        constexpr explicit WrappedValue(double val): m_value{val}{}

        constexpr bool operator<=>(WrappedValue const&) const = default

        constexpr double value() const
        {return m_value; }

    private:
        double m_value;
};

Any of the following actions prevents the crash:

 * Remove `#include <utility>`
 * Make `operator<=>` non-constexpr
 * Make `operator<=>` non-defaulted


Error log:

<source>: In member function 'constexpr bool WrappedValue::operator<=>(const
WrappedValue&) const':

<source>:8:24: internal compiler error: Segmentation fault

    8 |         constexpr bool operator<=>(WrappedValue const&) const =
default;

      |                        ^~~~~~~~

Please submit a full bug report,

with preprocessed source if appropriate.

See <https://gcc.gnu.org/bugs/> for instructions.

Compiler returned: 1


On compiler explorer: https://gcc.godbolt.org/z/mo7HkG

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

* [Bug c++/96064] Defaulted constexpr spaceship operator triggers internal compiler error after including utility
  2020-07-05  8:06 [Bug c++/96064] New: Defaulted constexpr spaceship operator triggers internal compiler error after including utility milasudril at gmail dot com
@ 2020-07-08 22:04 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-08 22:04 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like a dup.

*** This bug has been marked as a duplicate of bug 96060 ***

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

end of thread, other threads:[~2020-07-08 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05  8:06 [Bug c++/96064] New: Defaulted constexpr spaceship operator triggers internal compiler error after including utility milasudril at gmail dot com
2020-07-08 22:04 ` [Bug c++/96064] " 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).