public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99081] New: Misleading -Wmissing-field-initializers warning on out-of-order designated initializers
@ 2021-02-12 21:32 rs2740 at gmail dot com
  2021-04-14  9:53 ` [Bug c++/99081] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: rs2740 at gmail dot com @ 2021-02-12 21:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99081
           Summary: Misleading -Wmissing-field-initializers warning on
                    out-of-order designated initializers
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

struct A {
    int a; int b;
};

A a { .b = 1, .a = 2};

with g++ -std=c++2a -O3 -Wall -Wextra produces

<source>:5:21: warning: missing initializer for member 'A::a'
[-Wmissing-field-initializers]
    5 | A a { .b = 1, .a = 2};
      |                     ^
<source>:5:21: error: designator order for field 'A::a' does not match
declaration order in 'A'

The real problem is the error, of course, but the warning is just noise and
also incorrect - there is an initializer for a in the code, after all.

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

* [Bug c++/99081] Misleading -Wmissing-field-initializers warning on out-of-order designated initializers
  2021-02-12 21:32 [Bug c++/99081] New: Misleading -Wmissing-field-initializers warning on out-of-order designated initializers rs2740 at gmail dot com
@ 2021-04-14  9:53 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-14  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-04-14
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=82283
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

end of thread, other threads:[~2021-04-14  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 21:32 [Bug c++/99081] New: Misleading -Wmissing-field-initializers warning on out-of-order designated initializers rs2740 at gmail dot com
2021-04-14  9:53 ` [Bug c++/99081] " redi 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).