On 6/5/24 05:20, Simon Martin wrote:
On 5 Jun 2024, at 10:34, Jakub Jelinek wrote:
On Wed, Jun 05, 2024 at 08:13:14AM +0000, Simon Martin wrote:
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -2792,10 +2792,13 @@ duplicate_decls (tree newdecl, tree olddecl,
bool hiding, bool was_hidden)
retrofit_lang_decl (newdecl);
tree alias = DECL_LOCAL_DECL_ALIAS (newdecl)
= DECL_LOCAL_DECL_ALIAS (olddecl);
- DECL_ATTRIBUTES (alias)
- = (*targetm.merge_decl_attributes) (alias, newdecl);
- if (TREE_CODE (newdecl) == FUNCTION_DECL)
- merge_attribute_bits (newdecl, alias);
+ if (alias != error_mark_node)
+ {
+ DECL_ATTRIBUTES (alias) =
+ (*targetm.merge_decl_attributes) (alias, newdecl);
Formatting nit, = should be on the next line, not at the end of a
line.
See https://gcc.gnu.org/codingconventions.html and
https://gcc.gnu.org/codingconventions.html
Indeed, thanks. This is fixed in the attached updated patch.
OK.