diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-08 06:39:10 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-08 06:39:10 +0000 |
commit | bafc7b1d1e13beb1e2f33e3fbfbced3f7a35a272 (patch) | |
tree | f25f41dab1dcd5d2a05e3da964ef44446931df8b /gcc/c | |
parent | 00381c958f06816778aeffee325771fdad37a65b (diff) | |
download | gcc-bafc7b1d1e13beb1e2f33e3fbfbced3f7a35a272.tar.gz |
PR c/71418
* c-decl.c (grokdeclarator): Check TYPE_P.
* gcc.dg/noncompile/pr71418.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237195 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index de23e36d0ea..8617f08f978 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2016-06-08 Marek Polacek <polacek@redhat.com> + + PR c/71418 + * c-decl.c (grokdeclarator): Check TYPE_P. + 2016-06-07 David Malcolm <dmalcolm@redhat.com> * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index d79802ee72c..ac83e2fa519 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -6313,7 +6313,7 @@ grokdeclarator (const struct c_declarator *declarator, } else if (TREE_CODE (type) == FUNCTION_TYPE) error_at (loc, "alignment specified for function %qE", name); - else if (declspecs->align_log != -1) + else if (declspecs->align_log != -1 && TYPE_P (type)) { alignas_align = 1U << declspecs->align_log; if (alignas_align < min_align_of_type (type)) |