Test false auto_ptr positive.

Assignments after a function returning an auto_ptr is declared are
detected as auto_ptr assignments!
This commit is contained in:
Benjamin Wolsey 2011-07-20 08:04:01 +02:00
parent 3cfef6285c
commit c983608d88
1 changed files with 6 additions and 0 deletions

View File

@ -1376,6 +1376,12 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("[test.cpp:6]: (style) Copy 'auto_ptr' pointer to another do not create two equal objects since one has lost its ownership of the pointer.\n", errout.str()); ASSERT_EQUALS("[test.cpp:6]: (style) Copy 'auto_ptr' pointer to another do not create two equal objects since one has lost its ownership of the pointer.\n", errout.str());
check("std::auto_ptr<A> function();\n"
"int quit;"
"void f() { quit = true; }\n"
);
ASSERT_EQUALS("", errout.str());
// ticket #748 // ticket #748
check("void f() \n" check("void f() \n"
"{\n" "{\n"