Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 23682 - gcc 2.96 20000731 fails to compile anonymous unions
gcc 2.96 20000731 fails to compile anonymous unions
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-01-09 18:44 EST by Bukola Adeoye
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-01-31 07:49:08 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 Bukola Adeoye 2001-01-09 18:44:47 EST
Please take a look at the snippet of code below; which models a code style 
I am trying to port onto RedHat 7.0

class Base
Comment 1 Bukola Adeoye 2001-01-09 18:56:46 EST
I am sorry about the earlier message, I unwittingly 'committed' my message. 
Herein is the full description of the bug in question:

class Base
    int m_i;

class Derived : public Base
     int m_i;

int main ()
  return 1;

If I run this snippet of code through the above-mentioned compiler, it spewed 
out the error message appended below. As far as I know this code is in 
compliance with ANSI C++ standard, I cant think of any clause being violated. 
Could you please investigate the problem with your latest compiler, thanks.

=====================Start of compiler 2.96 output=================
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2 -v -
D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -
Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu
(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__ good.cpp 
GNU CPP version 2.96 20000731 (Red Hat Linux 7.0) (cpplib)
 (i386 Linux/ELF)
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus good.ii -quiet -dumpbase 
good.cpp -version -o good.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.0) (i386-redhat-linux) compiled 
by GNU C version 2.96 20000731 (Red Hat Linux 7.0).
good.cpp:17: declaration of `int Derived::{anonymous union}::m_i'
good.cpp:7: conflicts with previous declaration `int Base::{anonymous 
=====================End of compiler 2.96 output=================

Comment 2 Jakub Jelinek 2001-01-31 07:49:04 EST
I've submitted a patch for this to gcc-patches as
am awaiting approval for this. It will probably make it into the next gcc-c++
Comment 3 Jakub Jelinek 2001-02-05 16:04:26 EST
Fixed in gcc-c++-2.96-73 and above.
Comment 4 Bukola Adeoye 2001-02-19 14:47:43 EST
Thanks for the fix.

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