🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1482

second level unnamed union members not accessible

#1482
From: Ken Yap
Date: Fri, 07 Oct 1988 02:12
48 lines
1241 bytes
Problem:

Cannot refer to member of an unnamed union within another unnamed union.

Session log:

[elm 26] g++ -v -g bug2.cc
g++ version 1.25.1
 /u/cs454/lib/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix bug2.cc /tmp/cca13389.cpp
GNU CPP version 1.25.1
 /u/cs454/lib/gcc-c++ /tmp/cca13389.cpp -quiet -dumpbase bug2.cc -noreg -version-G -o /tmp/cca13389.s
GNU C++ version 1.25.1 (68k, MIT syntax) compiled by GNU C version 1.25.
In function int main ():
bug2.cc:20: structure has no member named `j'

Program:

struct foo
{
	union
	{
		int		i;
		union
		{
			int		j;
			float		f;
		};
	};
};

main()
{
	foo		bar;
	int		n = 42;

	bar.i = n;
	bar.j = n;
}

Version and environment:

g++ version 1.25.1

tm.h = tm-sun3.h
md = m68k.md
aux-output.c = output-m68k.c

sun 3-50, Sun Unix 3.4
Technical Details
Message-ID: <8810070212.AA13397@elm.cs.rochester.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!CS.ROCHESTER.EDU!ken

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!CS.ROCHESTER.EDU!ken
From: ken@CS.ROCHESTER.EDU (Ken Yap)
Newsgroups: gnu.g++.bug
Subject: second level unnamed union members not accessible
Message-ID: <8810070212.AA13397@elm.cs.rochester.edu>
Date: 7 Oct 88 02:12:05 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 48