This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64643] New: bad location for multiple fields in union initialized


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;
           ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]