CppUTest error with -std=c++11 on g++ 4.7.2 -
i've been using cpputest g++ 4.7.2 while without problems. however, i've flipped -std=c++11 option on can start using std::unique_ptr , fails immediately.
even compiling main module:
#include <cpputest/commandlinetestrunner.h> int main(int argc, char ** argv) { return commandlinetestrunner::runalltests(argc, argv); } fails variations on:
in file included /usr/include/cpputest/testharness.h:77:0, /usr/include/cpputest/commandlinetestrunner.h:31, tests/testmain.cpp:15: /usr/include/cpputest/memoryleakwarningplugin.h:56:53: error: declaration of ‘void* operator new(size_t) throw (std::bad_alloc)’ has different exception specifier in file included /usr/include/c++/4.7/ext/new_allocator.h:34:0, /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h:34, /usr/include/c++/4.7/bits/allocator.h:48, /usr/include/c++/4.7/string:43, /usr/include/cpputest/simplestring.h:136, /usr/include/cpputest/utest.h:34, /usr/include/cpputest/testharness.h:71, /usr/include/cpputest/commandlinetestrunner.h:31, tests/testmain.cpp:15: /usr/include/c++/4.7/new:93:7: error: previous declaration ‘void* operator new(std::size_t)’ removing -std=c++11 option makes work fine again.
the cpputest documentation makes comments macros conflicting overloaded new operators, , suggests #including standard headers first, problem without including headers @ all, although looks cpputest/commandlinetestrunner.h including <string> itself.
anyone come across before or know issue is?
Comments
Post a Comment