Compilation of tests with g++ -std=c++11 can warn about auto_ptr
Brought to you by:
blep
If I compile a file with more than one class derived from CppUnit::TestFixture under gcc/g++ 4.7.2 (Debian 4.7.2-5) on Debian Wheezy (cppunit-1.12-1). The CPPUNIT_TEST_SUITE_END macro invocation in all but the first class will warn that auto_ptr is deprecated.
Workaround choice of:
1. Break up compilation units so that only one test fixture is in each file.
2. Add -Wdeprecated-declarations to the compilation flags.
Desired solution:
Conditionally use unique_ptr or shared_ptr as appropriate if the compilation standard level is at c++-11.0 or higher(?) (checking the value of __cplusplus).