Bug 119526 - standard attributes should be preserved in redeclarations
Summary: standard attributes should be preserved in redeclarations
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-29 07:59 UTC by uecker
Modified: 2025-03-31 21:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uecker 2025-03-29 07:59:35 UTC
In the following example the attribute should be propagated to test3:

struct [[deprecated]] foo;
struct foo* test1;

struct foo { int x; };
struct foo* test2;

struct foo { int x; };
struct foo* test3;

int f()
{
    test2;
    test3;
}
Comment 1 uecker 2025-03-29 08:00:36 UTC
.
Comment 2 James Y Knight 2025-03-31 21:49:59 UTC
Presumably also in this example, "i" should remain deprecated:

struct S {
  char c;
  [[deprecated]] int i;
};

struct S {
  char c;
  int i;
};