Bug 28535 - gcc (g++) fails to build OpenSP, egcs++ works.
gcc (g++) fails to build OpenSP, egcs++ works.
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
http://download.sourceforge.net/openj...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-20 23:46 EST by Terje Bless
Modified: 2007-04-18 12:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-21 19:32:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Preprosessed C++ source (-save-temps) (334.69 KB, text/plain)
2001-02-21 19:32 EST, Terje Bless
no flags Details

  None (edit)
Description Terje Bless 2001-02-20 23:46:19 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22smp i686)


Building OpenSP with g++ fails with an error related to an inaccessible
class. Using egcs++ works. Both compilers are the stock Red Hat 7.0
versions.

(BTW: first bugreport. My cluelessness probably shines through, but it's
not polite to mention it. ;D)

Reproducible: Always
Steps to Reproduce:
1. Get OpenSP (URL above)
2. tar xzf OpenSP
3. ./configure
4. make
	

Actual Results:  The make stops with an error message about an inacessible
class "in this context".

Expected Results:  Uhm, the make should finish successfully? :-)

Relevant output of the make:

make[2]: Entering directory `/home/link/tmp/OpenSP-1.5pre5/nsgmls'
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../generic     -g -O2 -c
nsgmls.cxx
nsgmls.cxx: In method `void XRastEventHandler::message 
(OpenSP::MessageEvent *)':
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:60: within this context
nsgmls.cxx: In method `void XRastEventHandler::truncateOutput ()':
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:61: within this context
nsgmls.cxx: In method `void XRastEventHandler::allLinkTypesActivated 
()':
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:62: within this context
nsgmls.cxx: At top level:
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:64: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:64: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:66: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:66: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:67: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:67: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:68: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:68: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:69: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:69: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:70: within this context
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:70: within this context
nsgmls.cxx: In method `XRastEventHandler::XRastEventHandler 
(OpenSP::SgmlParser *, const char *, const StringC &, const 
OpenSP::OutputCodingSystem *, OpenSP::CmdLineApp *, OpenSP::Messenger 
*)':
../include/Message.h:157: `class OpenSP::Messenger' is inaccessible
nsgmls.cxx:243: within this context
make[2]: *** [nsgmls.o] Error 1
make[2]: Leaving directory `/home/link/tmp/OpenSP-1.5pre5/nsgmls'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/link/tmp/OpenSP-1.5pre5'
make: *** [all-recursive-am] Error 2
Comment 1 Jakub Jelinek 2001-02-21 17:08:19 EST
Can you please run
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../generic     -g -O2 -c nsgmls.cxx -save-temps
and attach here nsgmls.ii it creates?
It looks like bug in OpenSP (g++ 2.96 is much stricter and closer
to ISO C++), but after looking at the preprocessed source I could
tell more.
Comment 2 Terje Bless 2001-02-21 19:32:21 EST
Created attachment 10722 [details]
Preprosessed C++ source (-save-temps)
Comment 3 Jakub Jelinek 2001-02-22 09:16:04 EST
Ok, here is what our C++ lawyers said:
The compiler is correct; the example is in error.  Lookup of 'Messenger' in
XRastEventHandler finds the implicit declaration of Messenger within RastEventHandler, which is inaccessible.
The example should say OpenSP::Messenger.

Simplified testcase is:
struct Messenger {
};

struct RastEventHandler : private Messenger {
};

struct XRastEventHandler : public RastEventHandler {
  Messenger *Messenger_;
};

so OpenSP should be fixed.

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