parent
9259aea317
commit
0a72cd3b72
|
@ -3251,7 +3251,7 @@ bool Tokenizer::simplifyUsing()
|
|||
skip = true;
|
||||
simplifyUsingError(usingStart, usingEnd);
|
||||
}
|
||||
tok1 = after;
|
||||
tok1 = after->previous();
|
||||
}
|
||||
|
||||
if (!skip)
|
||||
|
|
|
@ -72,6 +72,7 @@ private:
|
|||
TEST_CASE(simplifyUsing25);
|
||||
TEST_CASE(simplifyUsing26); // #11090
|
||||
TEST_CASE(simplifyUsing27);
|
||||
TEST_CASE(simplifyUsing28);
|
||||
|
||||
TEST_CASE(simplifyUsing8970);
|
||||
TEST_CASE(simplifyUsing8971);
|
||||
|
@ -675,6 +676,16 @@ private:
|
|||
ASSERT_EQUALS(expected, tok(code));
|
||||
}
|
||||
|
||||
void simplifyUsing28() { // #11795
|
||||
const char code[] = "void f() {\n"
|
||||
" using T = int;\n"
|
||||
" T* p{ new T };\n"
|
||||
"}\n";
|
||||
const char expected[] = "void f ( ) { int * p { new int } ; }";
|
||||
ASSERT_EQUALS(expected, tok(code, cppcheck::Platform::Type::Native, /*debugwarnings*/ true));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void simplifyUsing8970() {
|
||||
const char code[] = "using V = std::vector<int>;\n"
|
||||
"struct A {\n"
|
||||
|
|
Loading…
Reference in New Issue