Visual C++ Compiler Error C2745

Message Text

'token' : this token cannot be converted to an identifier


Error C2745 occurs because the argument given to an __identifier keyword is invalid. The token placeholder in the message text describes the argument as a type of token.

The __identifier keyword acts as an operator in the token stream. It takes as its one argument a token and it returns this token as an identifer. This is especially useful when the given token is one that the compiler might otherwise interpret as a keyword (depending perhaps on whether options such as /Ze are active).

Conversion is trivial when the given token is anyway an identifier, and is nearly trivial when the given token is a string. The other types of token that are permitted are:

Documentation Status

The product documentation says of this error only that “identifiers must be comprised of legal characters” but there is clearly more to this error.