Skip to content

Commit d6f3bfc

Browse files
committed
Visual Studio recognises __nullptr in C++ mode
Visual Studio C++ recognises __nullptr. https://learn.microsoft.com/en-us/cpp/extensions/nullptr-cpp-component-extensions?view=msvc-170 Fixes #8308
1 parent cbdab7f commit d6f3bfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ansi-c/scanner.l

+3-2
Original file line numberDiff line numberDiff line change
@@ -1012,11 +1012,12 @@ enable_or_disable ("enable"|"disable")
10121012
TOK_CHAR16_T);
10131013
}
10141014

1015-
"__nullptr" { // GNU extension
1015+
"__nullptr" { // GNU, clang, VS extension
10161016
return conditional_keyword(
10171017
PARSER.cpp98 &&
10181018
(PARSER.mode==configt::ansi_ct::flavourt::GCC ||
1019-
PARSER.mode==configt::ansi_ct::flavourt::CLANG),
1019+
PARSER.mode==configt::ansi_ct::flavourt::CLANG ||
1020+
PARSER.mode==configt::ansi_ct::flavourt::VISUAL_STUDIO),
10201021
TOK_NULLPTR);
10211022
}
10221023

0 commit comments

Comments
 (0)