Bug 25136 - missing error message
missing error message
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-28 09:00 EST by Dimitri Papadopoulos
Modified: 2007-03-26 23:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-02 11:55:31 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)

  None (edit)
Description Dimitri Papadopoulos 2001-01-28 09:00:11 EST
Hi,

Compile the following program:
	class Foo {
	private:
		struct Internal {
		};
		struct Bah {
			Internal i;
		};
	};
	struct Bah {
		Foo::Internal i;
	};

The following error message is emitted:
	foo.cc:3: `struct Foo::Internal' is private
	foo.cc:10: within this context
which translated to English means:
	'Foo::Internal' is not accessible from 'Bah'.

I understand the following error message should also be emitted according
to
paragraph 11.8 of ISO C++:
	foo.cc:3: `struct Foo::Internal' is private
	foo.cc:6: within this context
which translated to English should mean:
	'Foo::Internal' is not accessible from 'Foo::Bah'.

Thanks.
Comment 1 Jakub Jelinek 2001-02-02 11:51:02 EST
Pass -O2 -fno-inline -D__NO_STRING_INLINES then. Really, there is nothing
glibc can do about this (apart from exporting all those inlines as static
functions but that makes no sense) and gcc does not pass any macros
which would tell whether -finline or -fno-inline was passed, so it has to use
__OPTIMIZE__ (and has done that for ages).
Comment 2 Jakub Jelinek 2001-02-02 11:53:23 EST
Oops, sorry, this was meant to resolve #25731 and I typed it into a wrong
window. I think you're right, my reading of 11.8 tells me the same, I'll look
into it soon.
Comment 3 Jakub Jelinek 2001-02-02 13:57:46 EST
And I was wrong (quoting Jason Merrill):
This has changed since the publication of the standard; nested
classes now have access to their containing classes.
Comment 4 Dimitri Papadopoulos 2001-02-03 07:38:08 EST
I've indeed found this:
	http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#45

However this is only a proposal as I understand it. The standard still
applies. Anyway the proposal will probably be changed accordingly so I
agree there's no point in adding an error message now and removing it
later.

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