Commit 0c923157 by Jason Merrill Committed by Jason Merrill

PR c++/85240 - LTO ICE with using of undeduced auto fn.

	* cp-gimplify.c (cp_genericize_r): Discard using of undeduced auto.

From-SVN: r259177
parent d8ab9ce0
2018-04-06 Jason Merrill <jason@redhat.com>
PR c++/85240 - LTO ICE with using of undeduced auto fn.
* cp-gimplify.c (cp_genericize_r): Discard using of undeduced auto.
2018-04-05 Jakub Jelinek <jakub@redhat.com> 2018-04-05 Jakub Jelinek <jakub@redhat.com>
PR c++/85209 PR c++/85209
......
...@@ -1294,16 +1294,20 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) ...@@ -1294,16 +1294,20 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
} }
if (block) if (block)
{ {
tree using_directive; tree decl = TREE_OPERAND (stmt, 0);
gcc_assert (TREE_OPERAND (stmt, 0)); gcc_assert (decl);
using_directive = make_node (IMPORTED_DECL); if (undeduced_auto_decl (decl))
TREE_TYPE (using_directive) = void_type_node; /* Omit from the GENERIC, the back-end can't handle it. */;
else
{
tree using_directive = make_node (IMPORTED_DECL);
TREE_TYPE (using_directive) = void_type_node;
IMPORTED_DECL_ASSOCIATED_DECL (using_directive) IMPORTED_DECL_ASSOCIATED_DECL (using_directive) = decl;
= TREE_OPERAND (stmt, 0); DECL_CHAIN (using_directive) = BLOCK_VARS (block);
DECL_CHAIN (using_directive) = BLOCK_VARS (block); BLOCK_VARS (block) = using_directive;
BLOCK_VARS (block) = using_directive; }
} }
/* The USING_STMT won't appear in GENERIC. */ /* The USING_STMT won't appear in GENERIC. */
*stmt_p = build1 (NOP_EXPR, void_type_node, integer_zero_node); *stmt_p = build1 (NOP_EXPR, void_type_node, integer_zero_node);
......
// PR c++/85240
// { dg-do compile { target c++14 } }
auto foo();
void bar()
{
using ::foo;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment