case POINTER_TYPE:
/* For two pointers, do this recursively on the target type. */
{
- tree pointed_to_1 = TREE_TYPE (t1);
- tree pointed_to_2 = TREE_TYPE (t2);
- tree target = composite_type_internal (pointed_to_1, pointed_to_2,
+ tree target = composite_type_internal (TREE_TYPE (t1), TREE_TYPE (t2),
cond, cache);
- t1 = c_build_pointer_type_for_mode (target, TYPE_MODE (t1), false);
- t1 = c_build_type_attribute_variant (t1, attributes);
- return qualify_type (t1, t2);
+ tree n = c_build_pointer_type_for_mode (target, TYPE_MODE (t1), false);
+ return c_build_type_attribute_qual_variant (n, attributes,
+ TYPE_QUALS (t2));
}
case ARRAY_TYPE:
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
if (!(attrval = comp_type_attributes (t1, t2)))
- return false;
+ return false;
if (2 == attrval)
data->warning_needed = true;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=c11" } */
+
+int * _Atomic __attribute__((visibility(""))) a; /* { dg-warning "attribute ignored" } */
+int * _Atomic a;
+
+int * _Atomic __attribute__((visibility("hidden"))) b; /* { dg-warning "attribute ignored" } */
+int * _Atomic b;
+