Bug 25136

Summary: missing error message
Product: [Retired] Red Hat Linux Reporter: Dimitri Papadopoulos <dpo>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-02 16:55:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dimitri Papadopoulos 2001-01-28 14:00:11 UTC
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 16:51:02 UTC
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 16:53:23 UTC
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 18:57:46 UTC
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 12:38:08 UTC
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.