parent
92d9e810f3
commit
f80e888b7e
|
@ -6408,15 +6408,15 @@ private:
|
||||||
"[test.cpp:11] -> [test.cpp:16]: (warning) Function 'func4' argument order different: declaration ', b, c' definition 'c, b, a'\n", errout.str());
|
"[test.cpp:11] -> [test.cpp:16]: (warning) Function 'func4' argument order different: declaration ', b, c' definition 'c, b, a'\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// #7846 - Syntax error when using C++11 braced-initializer in default argument
|
// #7846 - Syntax error when using C++11 braced-initializer in default argument
|
||||||
void cpp11FunctionArgInit() {
|
void cpp11FunctionArgInit() {
|
||||||
// syntax error is not expected
|
// syntax error is not expected
|
||||||
ASSERT_NO_THROW(check(
|
ASSERT_NO_THROW(check(
|
||||||
"\n void foo(int declaration = {}) {"
|
"\n void foo(int declaration = {}) {"
|
||||||
"\n for (int i = 0; i < 10; i++) {}"
|
"\n for (int i = 0; i < 10; i++) {}"
|
||||||
"\n }"
|
"\n }"
|
||||||
"\n "
|
"\n "
|
||||||
));
|
));
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2888,10 +2888,10 @@ private:
|
||||||
" delete [] *dataPtr;\n"
|
" delete [] *dataPtr;\n"
|
||||||
"}";
|
"}";
|
||||||
const char exp[] = "int main ( ) {\n"
|
const char exp[] = "int main ( ) {\n"
|
||||||
"char * data ; data = new char [ 100 ] ;\n"
|
"char * data ; data = new char [ 100 ] ;\n"
|
||||||
"char * * dataPtr ; dataPtr = & data ;\n"
|
"char * * dataPtr ; dataPtr = & data ;\n"
|
||||||
"printf ( \"test\" ) ;\n"
|
"printf ( \"test\" ) ;\n"
|
||||||
"delete [ ] data ;\n"
|
"delete [ ] data ;\n"
|
||||||
"}";
|
"}";
|
||||||
ASSERT_EQUALS(exp, tokenizeAndStringify(code, /*simplify=*/true));
|
ASSERT_EQUALS(exp, tokenizeAndStringify(code, /*simplify=*/true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4105,10 +4105,10 @@ private:
|
||||||
|
|
||||||
void bracesInitCpp11() {
|
void bracesInitCpp11() {
|
||||||
functionVariableUsage(
|
functionVariableUsage(
|
||||||
"int fun() {\n"
|
"int fun() {\n"
|
||||||
" static int fpUnread{0};\n"
|
" static int fpUnread{0};\n"
|
||||||
" const int var{fpUnread++};\n"
|
" const int var{fpUnread++};\n"
|
||||||
" return var;\n"
|
" return var;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
);
|
);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
Loading…
Reference in New Issue