Please consider the code:
#include using namespace std; extern \"C\" void foo( void ); namespace A { template< int No >
It's a g++ bug. Exists in 4.4, fixed in 4.6.
UPD: It seems that it's triggered by a combination of template and namespace. extern "C" is not relevant, as it may be commented out and the error remains.
template
namespace
extern "C"