re PR c++/79654 (ICE on invalid c++ code in register_dtor_fn in cp/decl.c:7877)
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Feb 2017 18:00:35 +0000 (19:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Feb 2017 18:00:35 +0000 (19:00 +0100)
commitb7280ac2708e2a36337347de3c27e8fda914683e
tree2fb263f2ae604a84bb90c1499aca21471c380c7c
parent5c3f1d7b10ab48d50e80359eb18c0edc1e3ed402
re PR c++/79654 (ICE on invalid c++ code in register_dtor_fn in cp/decl.c:7877)

PR c++/79654
* decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
on error.
* pt.c (tsubst_decomp_names): Return error_mark_node if the first
decl after the decomposition artificial decl has error_mark_node.
* decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
instead of just == error_mark_node comparison.

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

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r245639
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp26.C [new file with mode: 0644]