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

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


Attachments (Terms of Use)

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.


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