Skip to content

Commit e9e3755

Browse files
committed
Add test
1 parent a4bd260 commit e9e3755

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/testother.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11935,9 +11935,9 @@ class TestOther : public TestFixture {
1193511935
// TODO: only used in a single place
1193611936
#define checkCustomSettings(...) checkCustomSettings_(__FILE__, __LINE__, __VA_ARGS__)
1193711937
template<size_t size>
11938-
void checkCustomSettings_(const char* file, int line, const char (&code)[size], const Settings& settings) {
11938+
void checkCustomSettings_(const char* file, int line, const char (&code)[size], const Settings& settings, bool cpp = true) {
1193911939
// Tokenize..
11940-
SimpleTokenizer tokenizer(settings, *this);
11940+
SimpleTokenizer tokenizer(settings, *this, cpp);
1194111941
ASSERT_LOC(tokenizer.tokenize(code), file, line);
1194211942

1194311943
// Check..
@@ -12010,6 +12010,12 @@ class TestOther : public TestFixture {
1201012010
" i = i++ + 2;\n"
1201112011
"}", settings11);
1201212012
ASSERT_EQUALS("[test.cpp:2:11]: (error) Expression 'i+++2' depends on order of evaluation of side effects [unknownEvaluationOrder]\n", errout_str());
12013+
12014+
// #14431
12015+
checkCustomSettings("int f(void) {\n"
12016+
" struct baz baz = {.bar = {.foo = {.foo = 1}}};\n"
12017+
"}\n", settings0, false);
12018+
ASSERT_EQUALS("", errout_str());
1201312019
}
1201412020

1201512021
void testEvaluationOrderSelfAssignment() {

0 commit comments

Comments
 (0)