@@ -34,10 +34,10 @@ class TestIncompleteStatement : public TestFixture {
3434 const Settings settings = settingsBuilder().severity(Severity::warning).build();
3535
3636#define check (...) check_(__FILE__, __LINE__, __VA_ARGS__)
37- void check_ (const char * file, int line, const char code[], bool inconclusive = false ) {
37+ void check_ (const char * file, int line, const char code[], bool inconclusive = false , bool cpp = true ) {
3838 const Settings settings1 = settingsBuilder (settings).certainty (Certainty::inconclusive, inconclusive).build ();
3939
40- std::vector<std::string> files (1 , " test.cpp" );
40+ std::vector<std::string> files (1 , cpp ? " test.cpp" : " test.c " );
4141 Tokenizer tokenizer (settings1, *this );
4242 PreprocessorHelper::preprocess (code, files, tokenizer, *this );
4343
@@ -743,7 +743,7 @@ class TestIncompleteStatement : public TestFixture {
743743 check (" void f() { char * const * a, * const * b; }" , true );
744744 ASSERT_EQUALS (" " , errout_str ());
745745
746- check (" void f() { char * const * a = 0, * volatile restrict * b; }" , true );
746+ check (" void f() { char * const * a = 0, * volatile restrict * b; }" , true , /* cpp */ false );
747747 ASSERT_EQUALS (" " , errout_str ());
748748
749749 check (" void f() { char * const * a = 0, * volatile const * b; }" , true );
0 commit comments