This is the mail archive of the gcc@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: PR c++/11987: why is it invalid?


Ian Lance Taylor wrote:

> ==================================================
> template <int dim> struct X { 
>   struct I { I(); void foo(); }; 
> }; 
>  
> template <int dim> struct Y : X<dim> { 
>     typedef typename X<dim>::I I; 
> }; 
>  
> template <int dim>
> void Y<dim>::I::foo () {}
> 
> template struct Y<1>;
> ==================================================

This should be invalid too, assuming I'm remembering correctly.  I think
you have to say X<dim>::I::foo() when you make the definition.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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