Re: [PATCH] c-family: copy attribute diagnostic fixes [PR113262]

2024-01-15 Thread Jason Merrill
On 1/9/24 03:52, Jakub Jelinek wrote: Hi! The copy attributes is allowed on decls as well as types and even has checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only works if it applies to a decl. In

Re: [PATCH] c-family: copy attribute diagnostic fixes [PR113262]

2024-01-09 Thread Jeff Law
On 1/9/24 01:52, Jakub Jelinek wrote: Hi! The copy attributes is allowed on decls as well as types and even has checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only works if it applies to a decl.

Re: [PATCH] c-family: copy attribute diagnostic fixes [PR113262]

2024-01-09 Thread Marek Polacek
On Tue, Jan 09, 2024 at 09:52:17AM +0100, Jakub Jelinek wrote: > Hi! > > The copy attributes is allowed on decls as well as types and even has > checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics > unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only

[PATCH] c-family: copy attribute diagnostic fixes [PR113262]

2024-01-09 Thread Jakub Jelinek
Hi! The copy attributes is allowed on decls as well as types and even has checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only works if it applies to a decl. The following patch fixes that,