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

            Bug ID: 84441
           Summary: Internal compiler error
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egil.brendsdal at gmail dot com
  Target Milestone: ---

Created attachment 43450
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43450&action=edit
Preprocessed source code.

gcc 4.x and gcc 5.x compiles the following snippet, version 6.x and 7.x fails.

The compiler output is

/tmp/bug_report.cpp: In constructor 'derived::derived(int)':
/tmp/bug_report.cpp:15:84: internal compiler error: in assign_temp, at
function.c:968
 ( int n ) : base( n>=0 ? make_base( 1, n ) : make_base( -1, (size_t)0-n ) ) {
}
                                                                           ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccye5Pzm.out file, please attach this to
your bugreport.

+===+

#include <string>

struct base
{
  typedef std::string string;

  string r;
  int    e;
};

base make_base( int, size_t n );

struct derived : public base
{
  derived( int n ) : base( n>=0 ? make_base( 1, n ) : make_base( -1,
(size_t)0-n ) ) { }
};

derived f() { return derived(1); }

Reply via email to