This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6289: partial template specialization and friend


Reichelt wrote:
> 
> Hi,
> 
> here's an even shorter example:
> 
> ---------------------------snip here--------------------------
> template <typename T> class B
> {
>     typedef int X;
>     friend class X;
> };
> ---------------------------snip here--------------------------
> 
> This is in fact legal code (and is accepted by SGI's and Comeau's
> compiler for example). It would be illegal, if the friend declaration
no it is ill formed. [7.1.5.3]/2 says
	if the identifier resolves to a typedef name, or a template
	type-parameter, the elaborated type specifier is ill-formed.

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
           The voices in my head told me to say this
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]