Bug 32162 - G++ barfs on anonymous union
G++ barfs on anonymous union
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-18 18:01 EST by Ralph Loader
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-26 11:27:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ralph Loader 2001-03-18 18:01:06 EST
The follow code incorrectly fails to compile with G++ 2.96-78:

#include <string>

struct AStruct
   union {
      int a;
   std::string str;

AStruct global;

void Foo (const AStruct & other)
   global = other;

The error is:

temp.cc: In method `AStruct &AStruct::operator= (const AStruct &)':
temp.cc:7: `AStruct::{anonymous union} &AStruct::{anonymous
union}::operator= (const AStruct::{anonymous union} &)' is inaccessible
temp.cc:15: within this context
Comment 1 Jakub Jelinek 2001-03-26 11:26:24 EST
I've fixed this last thursday in CVS gcc, the fix will be included in
Comment 2 Jakub Jelinek 2001-03-26 11:26:58 EST
Oh, just FYI, the patch is at

Note You need to log in before you can comment on or make changes to this bug.