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

            Bug ID: 64643
           Summary: bad location for multiple fields in union initialized
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: deni_ at hotmail dot fr

For the following snipet of code 

-----------

class a
{
 union
  {
    bool b = false;
    bool f = false;
  };
};

----------

with gcc 5.0 I get this warning:
./test.c:4:3: error: multiple fields in union ‘a::<anonymous union>’
initialized
   {
   ^

What I would expect from gcc:
./test.c:5:5: error: multiple fields in union ‘a::<anonymous union>’
initialized
    bool b = false;
           ^
./test.c:6:5 note: a field is already initialized here
    bool f = false;
           ^

Reply via email to