+2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58561
+ * dwarf2out.c (is_cxx_auto): New.
+ (is_base_type): Use it.
+ (gen_type_die_with_usage): Likewise.
+
2014-01-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Use
return base_type_result;
}
+/* A C++ function with deduced return type can have a TEMPLATE_TYPE_PARM
+ named 'auto' in its type: return true for it, false otherwise. */
+
+static inline bool
+is_cxx_auto (tree type)
+{
+ if (is_cxx ())
+ {
+ tree name = TYPE_NAME (type);
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = DECL_NAME (name);
+ if (name == get_identifier ("auto"))
+ return true;
+ }
+ return false;
+}
+
/* Given a pointer to an arbitrary ..._TYPE tree node, return nonzero if the
given input type is a Dwarf "fundamental" type. Otherwise return null. */
return 0;
default:
+ if (is_cxx_auto (type))
+ return 0;
gcc_unreachable ();
}
break;
default:
- // A C++ function with deduced return type can have
- // a TEMPLATE_TYPE_PARM named 'auto' in its type.
- if (is_cxx ())
+ if (is_cxx_auto (type))
{
- tree name = TYPE_NAME (type);
- if (TREE_CODE (name) == TYPE_DECL)
- name = DECL_NAME (name);
- if (name == get_identifier ("auto"))
+ if (!auto_die)
{
- if (!auto_die)
- {
- auto_die = new_die (DW_TAG_unspecified_type,
- comp_unit_die (), NULL_TREE);
- add_name_attribute (auto_die, "auto");
- }
- equate_type_number_to_die (type, auto_die);
- break;
+ auto_die = new_die (DW_TAG_unspecified_type,
+ comp_unit_die (), NULL_TREE);
+ add_name_attribute (auto_die, "auto");
}
+ equate_type_number_to_die (type, auto_die);
+ break;
}
gcc_unreachable ();
}