Index: clang/lib/Lex/PPMacroExpansion.cpp =================================================================== --- clang/lib/Lex/PPMacroExpansion.cpp +++ clang/lib/Lex/PPMacroExpansion.cpp @@ -1813,7 +1813,11 @@ if (!Tok.isAnnotation() && Tok.getIdentifierInfo()) Tok.setKind(tok::identifier); - else { + else if (Tok.is(tok::string_literal)) { + const StringRef StrData(Tok.getLiteralData() + 1, Tok.getLength() - 2); + Tok.setIdentifierInfo(this->getIdentifierInfo(StrData)); + Tok.setKind(tok::identifier); + } else { Diag(Tok.getLocation(), diag::err_pp_identifier_arg_not_identifier) << Tok.getKind(); // Don't walk past anything that's not a real token. Index: clang/test/Parser/MicrosoftExtensions.cpp =================================================================== --- clang/test/Parser/MicrosoftExtensions.cpp +++ clang/test/Parser/MicrosoftExtensions.cpp @@ -270,8 +270,10 @@ // FIXME: We should pick a friendlier display name for this token kind. __identifier(1) // expected-error {{cannot convert token to an identifier}} __identifier(+) // expected-error {{cannot convert '+' token to an identifier}} - __identifier("foo") // expected-error {{cannot convert token to an identifier}} __identifier(;) // expected-error {{cannot convert ';' token to an identifier}} + __identifier("1"); // expected-error {{use of undeclared identifier '1'}} + __identifier("+"); // expected-error {{use of undeclared identifier '+'}} + __identifier(";"); // expected-error {{use of undeclared identifier ';'}} } class inline_definition_pure_spec {