[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#234709: Unable to parse declaration of inline constructor explicit specialization



retitle 234709 [fixed in 3.4] Unable to parse declaration of inline constructor explicit specialization
tags 234709 + upstream
tags 234709 + fixed-upstream
thanks

Stepan Vondrak writes:
> Package: g++-3.3
> Version: 3.3.3-0pre4
> 
> The following source does not compile:
> 
> template< int dimension >
> struct Vector {
>     inline Vector( void ) ;
> } ;
> template<> inline Vector< 3 >::Vector( void ) ;
> 
> GCC reports this error:
> gcc-error.cpp: In constructor `Vector<dimension>::Vector()
> [with int dimension = 3]':
> gcc-error.cpp:5: error: parse error before `;' token
> 
> GCC seems to interpret the declaration as a definition, and is confused by the 
> ';' token. It's able to parse the source if it's modified in any of the 
> following ways:
> - The specialization is defined, not declared.
> - The specialization is not 'inline'.
> - It's declaration of inline specialization of a non-constructor method (even 
> specialization of destructor works).
> 
> 
> -- Stepan Vondrak
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: