This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81847] New: ICE: in finish_expr_stmt, at cp/semantics.c:678
- From: "nsz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Aug 2017 11:16:04 +0000
- Subject: [Bug c++/81847] New: ICE: in finish_expr_stmt, at cp/semantics.c:678
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81847
Bug ID: 81847
Summary: ICE: in finish_expr_stmt, at cp/semantics.c:678
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nsz at gcc dot gnu.org
Target Milestone: ---
following code fails with ice with gcc 7.1.1:
constexpr int nlz(int x) {
return __builtin_constant_p(x) ? 0 : 1;
}
struct A {
constexpr A() { nlz(0); }
};
constexpr A operator-(A x) { return x; }
constexpr A bar() {
constexpr A x;
A y = -x;
return y;
}
$ g++ -S bar.cpp
bar.cpp: In function 'constexpr A bar()':
bar.cpp:13:10: internal compiler error: in finish_expr_stmt, at
cp/semantics.c:678
A y = -x;
^
...