Skip to content

Commit b092a13

Browse files
committed
char16_t and char32_t are typedefs in Visual Studio
1 parent 1e00fcf commit b092a13

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ansi-c/scanner.l

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,18 @@ and { return cpp98_keyword(TOK_ANDAND); }
749749
and_eq { return cpp98_keyword(TOK_ANDASSIGN); }
750750
bool { return cpp98_keyword(TOK_BOOL); }
751751
catch { return cpp98_keyword(TOK_CATCH); }
752-
char16_t { return cpp11_keyword(TOK_CHAR16_T); } // C++11
753-
char32_t { return cpp11_keyword(TOK_CHAR32_T); } // C++11
752+
char16_t { // C++11, but Visual Studio uses typedefs
753+
if(PARSER.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
754+
return make_identifier();
755+
else
756+
return cpp11_keyword(TOK_CHAR16_T);
757+
}
758+
char32_t { // C++11, but Visual Studio uses typedefs
759+
if(PARSER.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
760+
return make_identifier();
761+
else
762+
return cpp11_keyword(TOK_CHAR32_T);
763+
}
754764
class { return cpp98_keyword(TOK_CLASS); }
755765
compl { return cpp98_keyword('~'); }
756766
constexpr { return cpp11_keyword(TOK_CONSTEXPR); } // C++11

0 commit comments

Comments
 (0)