This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64643] New: bad location for multiple fields in union initialized
- From: "deni_ at hotmail dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 17 Jan 2015 10:29:57 +0000
- Subject: [Bug c++/64643] New: bad location for multiple fields in union initialized
- Auto-submitted: auto-generated
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;
^