public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103290] New: gcc 11 regression with C++ designated initializers, unions, anonymous struct
@ 2021-11-16 21:55 roland at gnu dot org
  2021-11-16 21:56 ` [Bug c++/103290] " pinskia at gcc dot gnu.org
  2021-11-16 21:57 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: roland at gnu dot org @ 2021-11-16 21:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103290

            Bug ID: 103290
           Summary: gcc 11 regression with C++ designated initializers,
                    unions, anonymous struct
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland at gnu dot org
  Target Milestone: ---

```
struct S {                                                                      
  union {                                                                       
    struct {                                                                    
      unsigned short x;                                                         
    } s;                                                                        
  };                                                                            
};                                                                              

S foo() {                                                                       
  S x = {.s = {.x = 1}};                                                        
  return x;                                                                     
}
```

with g++

produces error: 'S::<unnamed union>' has no non-static data member named 'x'

This is a regression from GCC 10.  The same code compiled as C still works.

Reproduced on trunk at 4cdf7db9a39d18bd536d816a5751d4d3cf23808b and on 11
branch at b52e2254b30445f3cd667ae0f0d99b183394e37b.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/103290] gcc 11 regression with C++ designated initializers,  unions, anonymous struct
  2021-11-16 21:55 [Bug c++/103290] New: gcc 11 regression with C++ designated initializers, unions, anonymous struct roland at gnu dot org
@ 2021-11-16 21:56 ` pinskia at gcc dot gnu.org
  2021-11-16 21:57 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-16 21:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103290

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 101767.

*** This bug has been marked as a duplicate of bug 101767 ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/103290] gcc 11 regression with C++ designated initializers,  unions, anonymous struct
  2021-11-16 21:55 [Bug c++/103290] New: gcc 11 regression with C++ designated initializers, unions, anonymous struct roland at gnu dot org
  2021-11-16 21:56 ` [Bug c++/103290] " pinskia at gcc dot gnu.org
@ 2021-11-16 21:57 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-16 21:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103290

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Sorry it is a dup of bug 102740.  Both are similar issues.

*** This bug has been marked as a duplicate of bug 102740 ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-16 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 21:55 [Bug c++/103290] New: gcc 11 regression with C++ designated initializers, unions, anonymous struct roland at gnu dot org
2021-11-16 21:56 ` [Bug c++/103290] " pinskia at gcc dot gnu.org
2021-11-16 21:57 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).