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

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



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




Reply to: