[Bug c++/95870] [9/10 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

2021-06-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95870

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|9.4 |9.5

--- Comment #13 from Richard Biener  ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

[Bug c++/95870] [9/10 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

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

--- Comment #12 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jason Merrill
:

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

commit r10-9845-gff24ef677edee888012aaddeb0ec9bbe366b4f57
Author: Jason Merrill 
Date:   Mon Apr 5 11:34:48 2021 -0400

c++: lambda in DMI in class template [PR95870]

Here enclosing_instantiation_of was failing to find a match because otctx
is
struct S and current_function_decl is S::S(), so the latter has
more
function contexts, and we end up trying to compare S() to NULL_TREE.

After spending a bit of time working on establishing the correspondence in
this case (class <=> constructor), it occurred to me that we could just use
DECL_SOURCE_LOCATION, which is unique for lambdas, since they cannot be
redeclared.  Since we're so close to release, for now I'm only doing this
for the case that was failing before.

gcc/cp/ChangeLog:

PR c++/95870
* pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION
if
there is no enclosing non-lambda function.

gcc/testsuite/ChangeLog:

PR c++/95870
* g++.dg/cpp0x/lambda/lambda-nsdmi10.C: New test.

[Bug c++/95870] [9/10 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

2021-05-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95870

--- Comment #11 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:2f1bb00ba340e53663651be7874011fd54e1d085

commit r12-804-g2f1bb00ba340e53663651be7874011fd54e1d085
Author: Jason Merrill 
Date:   Mon Apr 5 11:47:50 2021 -0400

c++: simplify enclosing_instantiation_of [PR95870]

Comparing DECL_SOURCE_LOCATION like the GCC 11 patch for PR 95870 will also
work for user-defined functions, if we update their location when
instantiating.  Another option would be to use LAMBDA_EXPR_REGEN_INFO for
lambdas, but this way is even simpler.

gcc/cp/ChangeLog:

PR c++/95870
* pt.c (enclosing_instantiation_of): Just compare
DECL_SOURCE_LOCATION.
(regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.

[Bug c++/95870] [9/10 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

2021-05-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95870

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.5 |9.4

--- Comment #10 from Jakub Jelinek  ---
GCC 8 branch is being closed.