[Bug c++/107148] [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252

2022-11-16 Thread jsm28 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107148

Joseph S. Myers  changed:

   What|Removed |Added

 CC||jsm28 at gcc dot gnu.org

--- Comment #2 from Joseph S. Myers  ---
The following test produces the same ICE without any prior errors. I'm not sure
if a statement expression should be considered valid in this context, or if
that indicates that an earlier error is needed. Compile this test with
-fimplicit-constexpr (thus, needs GCC 12 or later, so this test does not show a
regression, unlike the ICE-on-invalid regression in the original bug report).

int f(int);
class A {
public:
  A(int);
};
class C {
  C() : m(f(({ int x = 1; x; }))) {}
  A m;
};

Alternatively, not needing -fimplicit-constexpr (rejected by GCC 10 and before;
GCC 11 and later ICE; so again not showing a regression):

int f(int);
class A {
public:
  A(int);
};
class C {
  constexpr C() : m(f(({ int x = 1; x; }))) {}
  A m;
};

The failing assertion is

  gcc_assert (VAR_P (*p) && DECL_ARTIFICIAL (*p) && !TREE_STATIC (*p));

where *p is the variable x in the statement expression, so fails
DECL_ARTIFICIAL. If this test is valid, I don't know if it should reach the
code with this assertion (or what additional issues might arise if the variable
in the statement expression were declared static).

[Bug c++/107148] [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252

2022-10-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107148

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |10.5

[Bug c++/107148] [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252

2022-10-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107148

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2022-10-04
 Status|UNCONFIRMED |NEW

[Bug c++/107148] [10/11/12/13 Regression] ICE in bot_manip, at cp/tree.cc:3252

2022-10-04 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107148

Martin Liška  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Started likely with r11-7844-g6081d8994ed1a0ae.