@@ -9958,12 +9958,39 @@ class TestSymbolDatabase : public TestFixture {
99589958 ASSERT(tok && tok->valueType());
99599959 ASSERT_EQUALS("container(std :: set|unordered_set <) &", tok->valueType()->str());
99609960 }
9961+ struct U_constParameter_std_begin {
9962+
9963+ };
9964+
9965+ void f(S_constParameter_std_begin& s) {
9966+ std::for_each(std::begin(s.a), std::end(s.a), [](int& i) { ++i; });
9967+ }
9968+
9969+ void f(T_constParameter_std_begin& t) {
9970+ std::for_each(std::begin(t.v), std::end(t.v), [](int& i) { ++i; });
9971+ }
9972+
9973+ void f(U_constParameter_std_begin& u) {
9974+ std::for_each(std::begin(u.v[0][0]), std::end(u.v[0][0]), [](int& i) { ++i; });
9975+ }
99619976 {
99629977 GET_SYMBOL_DB("void f(std::vector<int> v) {\n"
99639978 " auto it = std::find(v.begin(), v.end(), 0);\n"
99649979 "}\n");
99659980 ASSERT_EQUALS("", errout_str());
99669981
9982+ const Token* tok = tokenizer.tokens();
9983+ tok = Token::findsimplematch(tok, "auto");
9984+ ASSERT(tok && tok->valueType());
9985+ ASSERT_EQUALS("iterator(std :: vector <)", tok->valueType()->str());
9986+ }
9987+ {
9988+ GET_SYMBOL_DB("struct S { std::vector<int> v[1][1]; };\n"
9989+ "void f(S& s) {\n"
9990+ " auto it = std::begin(s.v[0][0]);\n"
9991+ "}\n");
9992+ ASSERT_EQUALS("", errout_str());
9993+
99679994 const Token* tok = tokenizer.tokens();
99689995 tok = Token::findsimplematch(tok, "auto");
99699996 ASSERT(tok && tok->valueType());
0 commit comments