break;
}
}
+
+ /* Make sure we refer to the same type as the olddecl. */
+ DECL_ORIGINAL_TYPE (newdecl) = DECL_ORIGINAL_TYPE (olddecl);
}
/* Merge the data types specified in the two decls. */
to go look at the original type. */
t1 = c_type_original (t1);
t2 = c_type_original (t2);
+ gcc_checking_assert (!TYPE_NAME (t1)
+ || TREE_CODE (TYPE_NAME (t1)) == IDENTIFIER_NODE);
+ gcc_checking_assert (!TYPE_NAME (t2)
+ || TREE_CODE (TYPE_NAME (t2)) == IDENTIFIER_NODE);
if (TYPE_NAME (t1) != TYPE_NAME (t2))
return false;
--- /dev/null
+/* { dg-do "compile" } */
+/* { dg-options "-std=gnu23" } */
+
+typedef struct q { int x; } q_t;
+typedef struct q { int x; } q_t;
+typedef struct q { int x; } q_t;
+typedef struct q { int x; } q_t;
+typedef struct q { int x; } q_t;
+
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+
+extern struct s { int x; } s;
+extern struct s { int x; } s;
+extern struct s { int x; } s;
+extern struct s { int x; } s;
+extern struct s { int x; } s;
+
+struct t { int x; };
+struct t { int x; };
+struct t { int x; };
+struct t { int x; };
+struct t { int x; };
+
+typedef enum e { E = 1 } e_t;
+typedef enum e { E = 1 } e_t;
+typedef enum e { E = 1 } e_t;
+typedef enum e { E = 1 } e_t;
+typedef enum e { E = 1 } e_t;
+
--- /dev/null
+/* { dg-do "compile" } */
+/* { dg-options "-std=gnu23" } */
+
+typedef struct q { int x; } q_t;
+typedef struct q q_t;
+typedef struct q { int x; } q_t;
+typedef struct q q_t;
+typedef struct q { int x; } q_t;
+
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+typedef struct r r_t;
+
+extern struct s { int x; } s;
+extern struct s s;
+extern struct s { int x; } s;
+extern struct s s;
+extern struct s { int x; } s;
+
+struct t { int x; };
+struct t;
+struct t { int x; };
+struct t;
+struct t { int x; };
+
+typedef enum e { E = 1 } e_t;
+typedef enum e_t; /* { dg-warning "useless storage class specifier in empty declaration" } */
+typedef enum e { E = 1 } e_t;
+typedef enum e_t; /* { dg-warning "empty declaration with storage class specifier does not redeclare tag" } */
+typedef enum e { E = 1 } e_t;
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#define N 64
+
+struct f { int x; };
+typedef struct f T;
+typedef struct f T __attribute__((aligned (N)));
+typedef struct f T __attribute__((aligned (N * 2)));
+typedef struct f T __attribute__((aligned (N)));
+typedef struct f T;
+
+_Static_assert (_Alignof (T) == N * 2, "N * 2");
+
+enum g { A = 1 };
+typedef enum g S;
+typedef enum g S __attribute__((aligned (N)));
+typedef enum g S __attribute__((aligned (N * 2)));
+typedef enum g S __attribute__((aligned (N)));
+typedef enum g S;
+
+_Static_assert (_Alignof (S) == N * 2, "N * 2");
+