Commit 49e6a6c0 by Marek Polacek Committed by Marek Polacek

re PR c/82679 (Uses of typedefs of arrays of _Atomic-qualified types are rejected)

	PR c/82679
	* c-decl.c (grokdeclarator): Check declspecs insted of atomicp.

	* gcc.dg/c11-atomic-5.c: New test.

From-SVN: r255577
parent 6c939c2e
2017-12-12 Marek Polacek <polacek@redhat.com>
PR c/82679
* c-decl.c (grokdeclarator): Check declspecs insted of atomicp.
2017-12-12 Alexandre Oliva <aoliva@redhat.com> 2017-12-12 Alexandre Oliva <aoliva@redhat.com>
* c-objc-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true. * c-objc-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
......
...@@ -5813,7 +5813,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5813,7 +5813,7 @@ grokdeclarator (const struct c_declarator *declarator,
of typedefs or typeof) must be detected here. If the qualifier of typedefs or typeof) must be detected here. If the qualifier
is introduced later, any appearance of applying it to an array is is introduced later, any appearance of applying it to an array is
actually applying it to an element of that array. */ actually applying it to an element of that array. */
if (atomicp && TREE_CODE (type) == ARRAY_TYPE) if (declspecs->atomic_p && TREE_CODE (type) == ARRAY_TYPE)
error_at (loc, "%<_Atomic%>-qualified array type"); error_at (loc, "%<_Atomic%>-qualified array type");
/* Warn about storage classes that are invalid for certain /* Warn about storage classes that are invalid for certain
......
2017-12-12 Marek Polacek <polacek@redhat.com>
PR c/82679
* gcc.dg/c11-atomic-5.c: New test.
2017-12-12 Jakub Jelinek <jakub@redhat.com> 2017-12-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83363 PR rtl-optimization/83363
......
/* PR c/82679 */
/* { dg-do compile } */
/* { dg-options "-std=gnu11" } */
typedef _Atomic int A[10];
A a;
typedef _Atomic int I;
typedef I T[10];
T t;
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