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++/70353] New: static_assert + assert + c++14 crashes GCC


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

            Bug ID: 70353
           Summary: static_assert + assert + c++14 crashes GCC
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrlika at gmail dot com
  Target Milestone: ---

I use out-of-the-box GCC 5.2.1 in Ubuntu 15.10:

gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)

This code makes GCC crash when I define standard --std=c++14 or --std=c++17:

#include <cassert>

constexpr int ce(int r) {
  assert(r == 3);
  return r;
}

static_assert(ce(3) == 3, "static asser error");


Command to reproduce:
$ gcc --std=c++14 bug.cpp
bug.cpp:8:17:   in constexpr expansion of âce(3)â
bug.cpp:8:48: internal compiler error: Segmentation fault
 static_assert(ce(3) == 3, "static asser error");
                                                ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

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