aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.cc
diff options
context:
space:
mode:
authorMartin Uecker <uecker@tugraz.at>2023-08-15 14:58:32 +0200
committerMartin Uecker <uecker@tugraz.at>2023-12-21 08:43:10 +0100
commit23fee88f84873b0b8b41c8e5a9b229d533fb4022 (patch)
tree07d8a1dfd966671d648f7af84c230d231762ab13 /gcc/c/c-parser.cc
parent514ea1df444ca7f64c3f504ced05d8fb5fbfd62d (diff)
downloadgcc-23fee88f84873b0b8b41c8e5a9b229d533fb4022.zip
gcc-23fee88f84873b0b8b41c8e5a9b229d533fb4022.tar.gz
gcc-23fee88f84873b0b8b41c8e5a9b229d533fb4022.tar.bz2
c23: tag compatibility rules for struct and unions
Implement redeclaration and compatibility rules for structures and unions in C23. gcc/c/: * c-decl.cc (previous_tag): New function. (parser_xref_tag): Find earlier definition. (get_parm_info): Turn off warning for C23. (start_struct): Allow redefinitons. (finish_struct): Diagnose conflicts. * c-tree.h (comptypes_same_p): Add prototype. * c-typeck.cc (comptypes_same_p): New function. (comptypes_internal): Activate comparison of tagged types. (convert_for_assignment): Ignore qualifiers. (digest_init): Add error. (initialized_elementwise_p): Allow compatible types. gcc/testsuite/: * gcc.dg/c23-enum-7.c: Remove warning. * gcc.dg/c23-tag-1.c: New test. * gcc.dg/c23-tag-2.c: New deactivated test. * gcc.dg/c23-tag-3.c: New test. * gcc.dg/c23-tag-4.c: New test. * gcc.dg/c23-tag-5.c: New deactivated test. * gcc.dg/c23-tag-6.c: New test. * gcc.dg/c23-tag-7.c: New test. * gcc.dg/c23-tag-8.c: New test. * gcc.dg/gnu23-tag-1.c: New test. * gcc.dg/gnu23-tag-2.c: New test. * gcc.dg/gnu23-tag-3.c: New test. * gcc.dg/gnu23-tag-4.c: New test. * gcc.dg/pr112488-2.c: Remove warning.
Diffstat (limited to 'gcc/c/c-parser.cc')
0 files changed, 0 insertions, 0 deletions