diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index f8f89534341..135dd70517d 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -2480,6 +2480,14 @@ class TestLeakAutoVar : public TestFixture { " std::shared_ptr a{c, [](C* x) { delete x; }};\n" "}", true); ASSERT_EQUALS("", errout_str()); + + check("struct DirDeleter {\n" // #12544 + " void operator()(DIR* d) { ::closedir(d); }\n" + "};\n" + "void openDir(DIR* dir) {\n" + " std::shared_ptr dp(dir, DirDeleter());\n" + "}\n", true); + ASSERT_EQUALS("[test.cpp:2]: (information) --check-library: Function closedir() should have configuration\n", errout_str()); // don't crash } void smartPointerRelease() { check("void f() {\n"