[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Fixed.

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Thu Sep  5 15:37:52 2019
New Revision: 275421

URL: https://gcc.gnu.org/viewcvs?rev=275421=gcc=rev
Log:
PR c++/91644 - ICE with constinit in function template.
* decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
* pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
constinit variables.

* g++.dg/cpp2a/constinit13.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp2a/constinit13.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #3 from Marek Polacek  ---
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00161.html

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

--- Comment #2 from Marek Polacek  ---
I was afraid that that might happen.  Mine.

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
DECL_TEMPLATE_INFO is NULL for such VAR_DECLs, so:
7183  /* Handle `constinit' on variable templates.  */
7184  if (flags & LOOKUP_CONSTINIT)
7185TINFO_VAR_DECLARED_CONSTINIT (DECL_TEMPLATE_INFO (decl)) =
true;
segfaults.

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-09-03
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
  Build|10.0.0 20190902 |
   |(experimental)  |