This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49514] New: Crashes on valid use of constexpr constructor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49514

           Summary: Crashes on valid use of constexpr constructor
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


GCC crashes on this code:

/// snip
struct Vector4D {
  constexpr Vector4D(double x=0, double y=0, double z=0, double t=0)
    :components{x, y, z, t}, 
    x(components[0]), y(components[1]), z(components[2]), t(components[3]) 
    { }

  double components[4];
  double &x, &y, &z, &t;
};

Vector4D a{1, 2, 3};
/// snap

Error:

main1.cpp:11:19:   in constexpr expansion of âa.Vector4D::Vector4D(1.0e+0,
2.0e+0, 3.0e+0, 0.0)â
main1.cpp:11:19: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]