🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

G++ 2.3.3 Scoping Does Not Correctly Hide Typedef.

#1355
From: Dan R. Greening
Date: Thu, 07 Jan 1993 03:54
29 lines
1314 bytes
There is a bug, I believe, in G++ 2.3.3.  Compiling this:

    typedef int fixed;
    class ios {
      public:
	enum { fixed = 010000 };
	enum { floatfield = fixed };
      };

...results in this:

    bug.cc:6: warning: name `int' could be type or expression; compiler assuming type
    bug.cc:6: parse error before `;'

I believe this is a bug, because the declaration of the constant "fixed"
within ios should hide the typedef declaration.  I ran into this problem
when trying to use libg++ 2.3 streams in a program which declared "fixed"
as a type.  Of course, using

	enum { floatfield = ios::fixed };

cures the problem, but editing the libg++ include files is not something
you want to require measly users to do!

Regards,
-- 
____
\  /Dan Greening    Software Transformation   1601 Saratoga-Sunnyvale Rd, #100
 \/dgreen@sti.com   (408) 973-8081 x313       Cupertino, CA 95014
Technical Details
Message-ID: <1ii1qeINNajb@smurf.sti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sti.com!dgreen

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sti.com!dgreen
From: dgreen@sti.com (Dan R. Greening)
Subject: G++ 2.3.3 Scoping Does Not Correctly Hide Typedef.
Message-ID: <1ii1qeINNajb@smurf.sti.com>
Sender: gnulists@ai.mit.edu
Organization: Software Transformation, Inc.
Distribution: gnu
Date: Thu, 7 Jan 1993 03:54:54 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 30