Commit 3333a2dd by Jason Merrill Committed by Jason Merrill

* error.c (dump_type): Improve typedef handling.

From-SVN: r160184
parent 1e003829
2010-06-02 Jason Merrill <jason@redhat.com>
* error.c (dump_type): Improve typedef handling.
PR c++/9726
PR c++/23594
PR c++/44333
......
......@@ -329,6 +329,25 @@ dump_type (tree t, int flags)
if (t == NULL_TREE)
return;
/* Don't print e.g. "struct mytypedef". */
if (TYPE_P (t) && typedef_variant_p (t))
{
tree decl = TYPE_NAME (t);
if ((flags & TFF_CHASE_TYPEDEF)
|| DECL_SELF_REFERENCE_P (decl)
|| (!flag_pretty_templates
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)))
t = strip_typedefs (t);
else if (same_type_p (t, TREE_TYPE (decl)))
t = decl;
else
{
pp_cxx_cv_qualifier_seq (cxx_pp, t);
pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
return;
}
}
if (TYPE_PTRMEMFUNC_P (t))
goto offset_type;
......
2010-06-02 Jason Merrill <jason@redhat.com>
* g++.dg/ext/vector9.C: Expect typedef in error message.
PR c++/9726
PR c++/23594
PR c++/44333
......
......@@ -6,5 +6,5 @@ typedef int v4i __attribute__((vector_size(8)));
void foo()
{
v4f v;
!(v4i)v; // { dg-error "__vector.2. int|argument" }
!(v4i)v; // { dg-error "v4i|argument" }
}
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