[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

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

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

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

commit r10-9855-gfe0f9ef823dda3205638a2f23d08eb7d0bc497b9
Author: Jason Merrill 
Date:   Tue Apr 13 12:33:39 2021 -0400

c++: generic lambda in template fn with DMI [PR100054]

get_nsdmi instantiates default member initializers on demand.  It tries to
push into the context of the class before doing so, so access checking
works
properly, but since my patch for 90479 not for local classes.  We should
only be doing this when any template parameters have arguments.  But in
this
case, we get here while regenerating a generic lambda, so
processing_template_decl is true, even though the class and its DMI are
non-dependent at this point.  And so we crashed.  So let's do more of the
pushing into the context of the class even for local classes.

gcc/cp/ChangeLog:

PR c++/100054
PR c++/90479
* init.c (get_nsdmi): Do more context adjustment for local classes.

gcc/testsuite/ChangeLog:

PR c++/100054
* g++.dg/cpp1y/lambda-generic-local-class1.C: New test.

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-13 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

--- Comment #5 from Patrick Palka  ---
(In reply to Jason Merrill from comment #4)
> Fixed.  Apparently 90479 is the wrong PR number for the earlier change, I
> wonder what the correct one was.

Looks like it's PR90749

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-13 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #4 from Jason Merrill  ---
Fixed.  Apparently 90479 is the wrong PR number for the earlier change, I
wonder what the correct one was.

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

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

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

https://gcc.gnu.org/g:6173f713a35d5450f0e2acfdaec695b42632aeed

commit r11-8157-g6173f713a35d5450f0e2acfdaec695b42632aeed
Author: Jason Merrill 
Date:   Tue Apr 13 12:33:39 2021 -0400

c++: generic lambda in template fn with DMI [PR100054]

get_nsdmi instantiates default member initializers on demand.  It tries to
push into the context of the class before doing so, so access checking
works
properly, but since my patch for 90479 not for local classes.  We should
only be doing this when any template parameters have arguments.  But in
this
case, we get here while regenerating a generic lambda, so
processing_template_decl is true, even though the class and its DMI are
non-dependent at this point.  And so we crashed.  So let's do more of the
pushing into the context of the class even for local classes.

gcc/cp/ChangeLog:

PR c++/100054
PR c++/90479
* init.c (get_nsdmi): Do more context adjustment for local classes.

gcc/testsuite/ChangeLog:

PR c++/100054
* g++.dg/cpp1y/lambda-generic-local-class1.C: New test.

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-13 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

Richard Biener  changed:

   What|Removed |Added

  Known to fail||11.0
Version|10.0|11.0
  Known to work||10.3.0
   Priority|P3  |P1

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-12 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

--- Comment #2 from Barry Revzin  ---
In case it helps, here's a different example which on trunk ICEs in get_nsdmi,
but on gcc 10.2 and 10.3 ICEs on "unexpected expression '(F)()' of kind implicit_conv_expr" (and is accepted by 10.1)

struct F {
private:
  int cx;
};

template 
void find() {
struct H {
F o{};
};
using r = decltype([](auto) { return H{}; }(0));
}

void p() {
  find();
}

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-12 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054

Patrick Palka  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-04-12
   Keywords||ice-on-valid-code
 CC||jason at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
Summary|internal compiler error: in |[11 Regression] internal
   |get_nsdmi   |compiler error: in
   ||get_nsdmi

--- Comment #1 from Patrick Palka  ---
Confirmed, started with r11-17.

Slightly more reduced testcase:

template 
void f() {
  struct A { T m{}; };
  [](auto){ return A{}; };
}

template void f();