+2017-06-30 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/81229
+ * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
+ a matching TYPE_DECL.
+
2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
* class.c (add_method): Change pair of errors to error + inform.
; /* Ignore using decls here. */
else if (tree match = duplicate_decls (decl, *iter, is_friend))
{
- if (iter.hidden_p ()
- && match != error_mark_node
- && !DECL_HIDDEN_P (match))
+ if (match == error_mark_node)
+ ;
+ else if (TREE_CODE (match) == TYPE_DECL)
+ /* The IDENTIFIER will have the type referring to the
+ now-smashed TYPE_DECL, because ...? Reset it. */
+ SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (match));
+ else if (iter.hidden_p () && !DECL_HIDDEN_P (match))
{
/* Unhiding a previously hidden decl. */
tree head = iter.reveal_node (old);