This commit is contained in:
chrchr-github 2022-08-17 10:01:49 +02:00 committed by GitHub
parent 5f171b9673
commit 0978cc2d46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -7553,6 +7553,14 @@ private:
" virtual void VirtualMethod() = 0;\n"
"};");
ASSERT_EQUALS("", errout.str());
// #10559
checkVirtualFunctionCall("struct S {\n"
" S(const int x) : m(std::bind(&S::f, this, x, 42)) {}\n"
" virtual int f(const int x, const int y) = 0;\n"
" std::function<int()> m;\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
void pureVirtualFunctionCallOtherClass() {

View File

@ -424,6 +424,7 @@ private:
TEST_CASE(noCrash2);
TEST_CASE(noCrash3);
TEST_CASE(noCrash4);
TEST_CASE(noCrash5); // #10603
// --check-config
TEST_CASE(checkConfiguration);
@ -7094,6 +7095,12 @@ private:
"}\n"));
}
void noCrash5() // #10603
{
ASSERT_NO_THROW(tokenizeAndStringify("class B { using shared_ptr = std::shared_ptr<Foo>; };\n"
"class D : public B { void f(const std::shared_ptr<int>& ptr) {} };\n"));
}
void checkConfig(const char code[]) {
errout.str("");