diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-03-19 07:55:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-03-19 07:55:31 +0100 |
commit | 855cd9b166c70a6e5a90e342314e71203f15b8f4 (patch) | |
tree | 9ddfbc3610e58fb61e81cdbfc2f7416da95060ee /gcc/c | |
parent | 7babd3e4f197e59638addba04717609adebde4de (diff) | |
download | gcc-855cd9b166c70a6e5a90e342314e71203f15b8f4.zip gcc-855cd9b166c70a6e5a90e342314e71203f15b8f4.tar.gz gcc-855cd9b166c70a6e5a90e342314e71203f15b8f4.tar.bz2 |
re PR c/89734 (const qualifier on return type not erased inside __typeof__)
PR c/89734
* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
return type even if quals_used is 0. Formatting fixes.
* gcc.dg/pr89734.c: New test.
From-SVN: r269789
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index fafc6a5..fd3d009 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2019-03-19 Jakub Jelinek <jakub@redhat.com> + + PR c/89734 + * c-decl.c (grokdeclarator): Call c_build_qualified_type on function + return type even if quals_used is 0. Formatting fixes. + 2019-03-14 Richard Biener <rguenther@suse.de> * c-tree.h (enum c_declspec_il): New. diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index d8fa109..e8b7ca4 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -6611,10 +6611,12 @@ grokdeclarator (const struct c_declarator *declarator, quals_used &= TYPE_QUAL_ATOMIC; if (quals_used && VOID_TYPE_P (type) && really_funcdef) pedwarn (specs_loc, 0, - "function definition has qualified void return type"); + "function definition has qualified void " + "return type"); else warning_at (specs_loc, OPT_Wignored_qualifiers, - "type qualifiers ignored on function return type"); + "type qualifiers ignored on function " + "return type"); /* Ensure an error for restrict on invalid types; the DR#423 resolution is not entirely clear about @@ -6624,8 +6626,7 @@ grokdeclarator (const struct c_declarator *declarator, && (!POINTER_TYPE_P (type) || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type)))) error_at (loc, "invalid use of %<restrict%>"); - if (quals_used) - type = c_build_qualified_type (type, quals_used); + type = c_build_qualified_type (type, quals_used); } type_quals = TYPE_UNQUALIFIED; |