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());
|
||||
}
|
||||
|
||||
// #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() {
|
||||
// syntax error is not expected
|
||||
ASSERT_NO_THROW(check(
|
||||
"\n void foo(int declaration = {}) {"
|
||||
"\n for (int i = 0; i < 10; i++) {}"
|
||||
"\n }"
|
||||
"\n "
|
||||
));
|
||||
"\n void foo(int declaration = {}) {"
|
||||
"\n for (int i = 0; i < 10; i++) {}"
|
||||
"\n }"
|
||||
"\n "
|
||||
));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2888,10 +2888,10 @@ private:
|
|||
" delete [] *dataPtr;\n"
|
||||
"}";
|
||||
const char exp[] = "int main ( ) {\n"
|
||||
"char * data ; data = new char [ 100 ] ;\n"
|
||||
"char * * dataPtr ; dataPtr = & data ;\n"
|
||||
"printf ( \"test\" ) ;\n"
|
||||
"delete [ ] data ;\n"
|
||||
"char * data ; data = new char [ 100 ] ;\n"
|
||||
"char * * dataPtr ; dataPtr = & data ;\n"
|
||||
"printf ( \"test\" ) ;\n"
|
||||
"delete [ ] data ;\n"
|
||||
"}";
|
||||
ASSERT_EQUALS(exp, tokenizeAndStringify(code, /*simplify=*/true));
|
||||
}
|
||||
|
|
|
@ -4105,10 +4105,10 @@ private:
|
|||
|
||||
void bracesInitCpp11() {
|
||||
functionVariableUsage(
|
||||
"int fun() {\n"
|
||||
" static int fpUnread{0};\n"
|
||||
" const int var{fpUnread++};\n"
|
||||
" return var;\n"
|
||||
"int fun() {\n"
|
||||
" static int fpUnread{0};\n"
|
||||
" const int var{fpUnread++};\n"
|
||||
" return var;\n"
|
||||
"}\n"
|
||||
);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
|
Loading…
Reference in New Issue