Bug 25136 - missing error message
Summary: missing error message
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2001-01-28 14:00 UTC by Dimitri Papadopoulos
Modified: 2007-03-27 03:39 UTC (History)
0 users

Clone Of:
Last Closed: 2001-02-02 16:55:31 UTC

Attachments (Terms of Use)

Description Dimitri Papadopoulos 2001-01-28 14:00:11 UTC

Compile the following program:
	class Foo {
		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
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'.


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:

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

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