Skip to content

Commit 1355610

Browse files
Update test.cpp
1 parent d86671f commit 1355610

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,6 +3259,12 @@ static void fuzz_crash()
32593259
"foo(f##oo(intp))\n";
32603260
(void)preprocess(code, simplecpp::DUI()); // do not crash
32613261
}
3262+
{ // #546
3263+
const char code[] = "#if __has_include<\n";
3264+
simplecpp::OutputList outputList;
3265+
ASSERT_EQUALS("", preprocess(code, &outputList)); // do not crash
3266+
ASSERT_EQUALS("file0,1,syntax_error,failed to evaluate #if condition\n", toString(outputList));
3267+
}
32623268
}
32633269

32643270
// memory leaks detected by LSAN/valgrind

0 commit comments

Comments
 (0)