On Wed, 24 Jan 2024, Andi Kleen wrote: > Implement a C23 clang compatible musttail attribute similar to the earlier > C++ implementation in the C parser.
I'd expect diagnostics, and associated tests of those diagnostics, for: * musttail attribute used with any arguments, even empty [[gnu::musttail()]], much like e.g. [[fallthrough()]] or [[maybe_unused()]] gets diagnosed. * musttail attribute used on a declaration, or as part of an attribute declaration (attributes on their own before a semicolon - whether musttail on its own, or together with the fallthrough attribute that is valid in that case). * musttail attribute used on any statement other than a return statement. All of these should definitely apply to the gnu:: form and probably to clang:: as well. Some of these might already be diagnosed, but I don't see them in the added testcases. For the first one of these, it may help to include the attribute in the c_common_gnu_attributes table so the common attribute parsing code knows that this one doesn't accept arguments (and with an attribute handler that always rejects it on declarations, much like handle_fallthrough_attribute). -- Joseph S. Myers josmy...@redhat.com