[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Jakub Jelinek  changed:

   What|Removed |Added

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

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

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Tue Apr 11 20:51:16 2017
New Revision: 246857

URL: https://gcc.gnu.org/viewcvs?rev=246857=gcc=rev
Log:
PR c++/80370
* decl.c (cp_finish_decomp): If processing_template_decl on
non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
processing.
* pt.c (value_dependent_expression_p) : For variables
with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
dependent.

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

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

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #5 from Jakub Jelinek  ---
Created attachment 41165
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41165=edit
gcc7-pr80370.patch

Untested fix.

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #4 from Vittorio Romeo  ---
Even shorter:


template  struct tuple_size { static constexpr int value = 1; };
template  struct tuple_element { typedef int type; };
template  struct tuple {};
template  int get(T);

int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Jakub Jelinek  changed:

   What|Removed |Added

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

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #3 from Jakub Jelinek  ---
Guess at least get should return int or int & rather than void:

template  struct tuple_size;
template  struct tuple_element;
template  struct tuple {};
template  struct tuple_size { static constexpr int
value = 1; };
template  struct tuple_element<0, tuple> {
typedef T type; };
template  int get (tuple);
int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Reduced testcase:
template  struct tuple_size;
template  struct tuple_element;
template  struct tuple {};
template  struct tuple_size { static constexpr int
value = 1; };
template  struct tuple_element<0, tuple> {
typedef T type; };
template  void get (tuple);
int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
  Known to work||5.4.0, 6.3.0
Summary|ICE (internal compiler  |[7 Regression] ICE when
   |error) when using   |using structured bindings
   |structured bindings and |and nested generic lambdas
   |nested generic lambdas  |(tsubst_decomp_names)
   |(tsubst_decomp_names)   |
 Ever confirmed|0   |1
  Known to fail||7.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r242377.