[Bug c++/97878] [8/9 Regression] ICE in cxx_eval_outermost_constant_expr, at cp/constexpr.c:6825

2021-04-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97878

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Jakub Jelinek  ---
Fixed.

[Bug c++/97878] [8/9 Regression] ICE in cxx_eval_outermost_constant_expr, at cp/constexpr.c:6825

2021-04-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97878

--- Comment #10 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:e4d046c7e828c0f81ad1f9dfa0418047028133fa

commit r8-10881-ge4d046c7e828c0f81ad1f9dfa0418047028133fa
Author: Jakub Jelinek 
Date:   Fri Feb 5 10:22:07 2021 +0100

c++: Fix ICE with structured binding initialized to incomplete array
[PR97878]

We ICE on the following testcase, for incomplete array a on auto [b] { a };
without
giving any kind of diagnostics, with auto [c] = a; during error-recovery.
The problem is that we get too far through check_initializer and e.g.
store_init_value -> constexpr stuff can't deal with incomplete array types.

As the type of the structured binding artificial variable is always
deduced,
I think it is easiest to diagnose this early, even if they have array types
we'll need their deduced type to be complete rather than just its element
type.

2021-02-05  Jakub Jelinek  

PR c++/97878
* decl.c (check_array_initializer): For structured bindings,
require
the array type to be complete.

* g++.dg/cpp1z/decomp54.C: New test.

(cherry picked from commit 8b7f2d3eae16dd629ae7ae40bb76f4bb0099f441)

[Bug c++/97878] [8/9 Regression] ICE in cxx_eval_outermost_constant_expr, at cp/constexpr.c:6825

2021-04-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97878

--- Comment #9 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:5c85df8968b00acc934396d7461a4a5ac6ddedd1

commit r9-9416-g5c85df8968b00acc934396d7461a4a5ac6ddedd1
Author: Jakub Jelinek 
Date:   Fri Feb 5 10:22:07 2021 +0100

c++: Fix ICE with structured binding initialized to incomplete array
[PR97878]

We ICE on the following testcase, for incomplete array a on auto [b] { a };
without
giving any kind of diagnostics, with auto [c] = a; during error-recovery.
The problem is that we get too far through check_initializer and e.g.
store_init_value -> constexpr stuff can't deal with incomplete array types.

As the type of the structured binding artificial variable is always
deduced,
I think it is easiest to diagnose this early, even if they have array types
we'll need their deduced type to be complete rather than just its element
type.

2021-02-05  Jakub Jelinek  

PR c++/97878
* decl.c (check_array_initializer): For structured bindings,
require
the array type to be complete.

* g++.dg/cpp1z/decomp54.C: New test.

(cherry picked from commit 8b7f2d3eae16dd629ae7ae40bb76f4bb0099f441)

[Bug c++/97878] [8/9 Regression] ICE in cxx_eval_outermost_constant_expr, at cp/constexpr.c:6825

2021-03-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97878

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9/10 Regression] ICE in  |[8/9 Regression] ICE in
   |cxx_eval_outermost_constant |cxx_eval_outermost_constant
   |_expr, at   |_expr, at
   |cp/constexpr.c:6825 |cp/constexpr.c:6825

--- Comment #8 from Jakub Jelinek  ---
Fixed for 10.3 too.