parent
4c1aeb0cb1
commit
ceb86afc22
|
@ -3111,7 +3111,7 @@ void Tokenizer::simplifyArrayAccessSyntax()
|
||||||
void Tokenizer::simplifyParameterVoid()
|
void Tokenizer::simplifyParameterVoid()
|
||||||
{
|
{
|
||||||
for (Token* tok = list.front(); tok; tok = tok->next()) {
|
for (Token* tok = list.front(); tok; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "%name% ( void )") && !Token::Match(tok, "sizeof|decltype|typeof")) {
|
if (Token::Match(tok, "%name% ( void )") && !Token::Match(tok, "sizeof|decltype|typeof|return")) {
|
||||||
tok->next()->deleteNext();
|
tok->next()->deleteNext();
|
||||||
tok->next()->setRemovedVoidParameter(true);
|
tok->next()->setRemovedVoidParameter(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,6 +372,12 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("void g();\n" // #10952
|
||||||
|
"bool f() {\n"
|
||||||
|
" return (void)g(), false;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("void f(int a, int b, int c, int d) {\n"
|
check("void f(int a, int b, int c, int d) {\n"
|
||||||
" Eigen::Vector4d V;\n"
|
" Eigen::Vector4d V;\n"
|
||||||
" V << a, b, c, d;\n"
|
" V << a, b, c, d;\n"
|
||||||
|
|
Loading…
Reference in New Issue