Add test case to reproduce bug
Add tokenizer test range based for with decltyle(x) *
This commit is contained in:
parent
840bd14c8b
commit
160b8f0f17
|
@ -6291,6 +6291,10 @@ private:
|
||||||
" for (const auto & e : array)\n"
|
" for (const auto & e : array)\n"
|
||||||
" foo(e);\n"
|
" foo(e);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
|
" void f3() {\n"
|
||||||
|
" for (decltype(auto) e : array)\n"
|
||||||
|
" foo(e);\n"
|
||||||
|
" }\n"
|
||||||
"};");
|
"};");
|
||||||
ASSERT_EQUALS("[test.cpp:8]: (style, inconclusive) Technically the member function 'Fred::f2' can be const.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:8]: (style, inconclusive) Technically the member function 'Fred::f2' can be const.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -7538,6 +7538,7 @@ private:
|
||||||
ASSERT_EQUALS("forx0=y(8<z;;(", testAst("for (x=0;(int)y<8;z);"));
|
ASSERT_EQUALS("forx0=y(8<z;;(", testAst("for (x=0;(int)y<8;z);"));
|
||||||
ASSERT_EQUALS("forab,c:(", testAst("for (auto [a,b]: c);"));
|
ASSERT_EQUALS("forab,c:(", testAst("for (auto [a,b]: c);"));
|
||||||
ASSERT_EQUALS("fora*++;;(", testAst("for (++(*a);;);"));
|
ASSERT_EQUALS("fora*++;;(", testAst("for (++(*a);;);"));
|
||||||
|
ASSERT_EQUALS("foryz:(", testAst("for (decltype(x) *y : z);"));
|
||||||
|
|
||||||
// problems with multiple expressions
|
// problems with multiple expressions
|
||||||
ASSERT_EQUALS("ax( whilex(", testAst("a(x) while (x)"));
|
ASSERT_EQUALS("ax( whilex(", testAst("a(x) while (x)"));
|
||||||
|
|
Loading…
Reference in New Issue