This commit is contained in:
parent
258581ce2e
commit
48dd4dc33e
|
@ -1394,7 +1394,7 @@ struct Executor {
|
|||
return execute(tok);
|
||||
});
|
||||
if (f) {
|
||||
if (fdepth >= 0) {
|
||||
if (fdepth >= 0 && !f->isImplicitlyVirtual()) {
|
||||
ProgramMemory functionState;
|
||||
for (std::size_t i = 0; i < args.size(); ++i) {
|
||||
const Variable* const arg = f->getArgumentVar(i);
|
||||
|
|
|
@ -2334,6 +2334,19 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("struct B { virtual int g() { return 0; } };\n" // #11831
|
||||
"struct C {\n"
|
||||
" int h() const { return b->g(); }\n"
|
||||
" B* b;\n"
|
||||
"};\n"
|
||||
"struct O {\n"
|
||||
" int f() const;\n"
|
||||
" std::vector<int> v;\n"
|
||||
" C c;\n"
|
||||
"};\n"
|
||||
"int O::f() const { return v[c.h() - 1]; }\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
const auto oldSettings = settings;
|
||||
settings.daca = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue