re PR c++/80370 (ICE when using structured bindings and nested generic lambdas (tsubs...
authorJakub Jelinek <jakub@redhat.com>
Tue, 11 Apr 2017 20:51:16 +0000 (22:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 11 Apr 2017 20:51:16 +0000 (22:51 +0200)
commit347e1f77696d8d69db2c9e66bba6e48662de8343
treef9b49b57950c4f011bc831074c00c11202b49c5a
parent98b5e81a05f482f0998e8565c9e9bb07cd5ad317
re PR c++/80370 (ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names))

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) <case VAR_DECL>: For variables
with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
dependent.

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

From-SVN: r246857
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp28.C [new file with mode: 0644]