Compiler Error C2061

syntax error : identifier 'identifier'

The compiler found identifier where it was not expected. This error can be caused by enclosing an initializer in parentheses. The error can be avoided by enclosing the declarator in parentheses or making it a typedef. The following example causes this error and shows two fixes:

class X {};
class Y {};
class Z {};
class W : public  X, public Y, public Z {};

void func ( W* pW )
{
    X* pX ( pW );     // Error: unexpected identifier 'pW'

    Y ( *pY ) ( pW ); // OK, declarator in parentheses

    typedef Z *pZ_t;
    pZ_t pZ ( pW );   // OK, typedef used for Z
}