diff options
author | Richard Guenther <rguenther@suse.de> | 2011-03-21 15:32:21 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-03-21 15:32:21 +0000 |
commit | 411cdbd841d21a48ebc7f89f6d62c60f3e0dad47 (patch) | |
tree | 7dac4958a64d9e0a01ed6573dd9934b15b0dd2cc /gcc/c-decl.c | |
parent | 1cd9e4164e333f1c4bfc32ed3dd5550b2e625d4a (diff) | |
download | gcc-411cdbd841d21a48ebc7f89f6d62c60f3e0dad47.zip gcc-411cdbd841d21a48ebc7f89f6d62c60f3e0dad47.tar.gz gcc-411cdbd841d21a48ebc7f89f6d62c60f3e0dad47.tar.bz2 |
re PR c/47939 (Missing DW_TAG_typedef for qualified types)
2011-03-21 Richard Guenther <rguenther@suse.de>
PR c/47939
* c-decl.c (grokdeclarator): Drop to the main variant only
for array types. Drop flag_gen_aux_info check.
* gcc.dg/debug/dwarf2/pr47939-1.c: New testcase.
* gcc.dg/debug/dwarf2/pr47939-2.c: Likewise.
* gcc.dg/debug/dwarf2/pr47939-3.c: Likewise.
* gcc.dg/debug/dwarf2/pr47939-4.c: Likewise.
From-SVN: r171245
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4e82f28..1af3d23 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4888,6 +4888,7 @@ grokdeclarator (const struct c_declarator *declarator, const char *errmsg; tree expr_dummy; bool expr_const_operands_dummy; + enum c_declarator_kind first_non_attr_kind; if (TREE_CODE (type) == ERROR_MARK) return error_mark_node; @@ -4907,6 +4908,7 @@ grokdeclarator (const struct c_declarator *declarator, { const struct c_declarator *decl = declarator; + first_non_attr_kind = cdk_attrs; while (decl) switch (decl->kind) { @@ -4918,6 +4920,8 @@ grokdeclarator (const struct c_declarator *declarator, case cdk_pointer: funcdef_syntax = (decl->kind == cdk_function); decl = decl->declarator; + if (first_non_attr_kind == cdk_attrs) + first_non_attr_kind = decl->kind; break; case cdk_attrs: @@ -4928,6 +4932,8 @@ grokdeclarator (const struct c_declarator *declarator, loc = decl->id_loc; if (decl->u.id) name = decl->u.id; + if (first_non_attr_kind == cdk_attrs) + first_non_attr_kind = decl->kind; decl = 0; break; @@ -5034,7 +5040,9 @@ grokdeclarator (const struct c_declarator *declarator, error_at (loc, "conflicting named address spaces (%s vs %s)", c_addr_space_name (as1), c_addr_space_name (as2)); - if (!flag_gen_aux_info && (TYPE_QUALS (element_type))) + if ((TREE_CODE (type) == ARRAY_TYPE + || first_non_attr_kind == cdk_array) + && TYPE_QUALS (element_type)) type = TYPE_MAIN_VARIANT (type); type_quals = ((constp ? TYPE_QUAL_CONST : 0) | (restrictp ? TYPE_QUAL_RESTRICT : 0) |