summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-12 19:22:32 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-12 19:22:32 +0000
commit6872c6893d2f1df56ab824341f45842c6de25e33 (patch)
treec655232105616ff04f82c5453361d13d83ac1b70 /gcc/cp
parent572a6d39e8cc1b80612edc2369a840c7c30afd0a (diff)
downloadgcc-6872c6893d2f1df56ab824341f45842c6de25e33.tar.gz
PR c++/79050 - ICE with undeduced auto and LTO
* decl.c (poplevel): Remove undeduced auto decls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@246884 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e28ec4aa4fa..3a937b3c804 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2017-04-12 Jason Merrill <jason@redhat.com>
+ PR c++/79050 - ICE with undeduced auto and LTO
+ * decl.c (poplevel): Remove undeduced auto decls.
+
PR c++/79461 - ICE with lambda in constexpr constructor
* constexpr.c (build_data_member_initialization): Ignore
initialization of a local variable.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 30a8c5a7171..21891e74e97 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -778,14 +778,17 @@ poplevel (int keep, int reverse, int functionbody)
back ends won't understand OVERLOAD, so we remove them here.
Because the BLOCK_VARS are (temporarily) shared with
CURRENT_BINDING_LEVEL->NAMES we must do this fixup after we have
- popped all the bindings. */
+ popped all the bindings. Also remove undeduced 'auto' decls,
+ which LTO doesn't understand, and can't have been used by anything. */
if (block)
{
tree* d;
for (d = &BLOCK_VARS (block); *d; )
{
- if (TREE_CODE (*d) == TREE_LIST)
+ if (TREE_CODE (*d) == TREE_LIST
+ || (!processing_template_decl
+ && undeduced_auto_decl (*d)))
*d = TREE_CHAIN (*d);
else
d = &DECL_CHAIN (*d);