Ошибка CppUTest с -std= C++11 на g++ 4.7.2
Я использую CppUTest с g++ 4.7.2 некоторое время без проблем. Тем не менее, я только что перевернул -std=c++11
вариант, чтобы я мог начать использовать std::unique_ptr
и это немедленно терпит неудачу.
Даже просто компилируя основной модуль:
#include <CppUTest/CommandLineTestRunner.h>
int main(int argc, char ** argv) {
return CommandLineTestRunner::RunAllTests(argc, argv);
}
терпит неудачу с изменениями на:
In file included from /usr/include/CppUTest/TestHarness.h:77:0,
from /usr/include/CppUTest/CommandLineTestRunner.h:31,
from tests/testmain.cpp:15:
/usr/include/CppUTest/MemoryLeakWarningPlugin.h:56:53: error: declaration of ‘void* operator new(size_t) throw (std::bad_alloc)’ has a different exception specifier
In file included from /usr/include/c++/4.7/ext/new_allocator.h:34:0,
from /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h:34,
from /usr/include/c++/4.7/bits/allocator.h:48,
from /usr/include/c++/4.7/string:43,
from /usr/include/CppUTest/SimpleString.h:136,
from /usr/include/CppUTest/Utest.h:34,
from /usr/include/CppUTest/TestHarness.h:71,
from /usr/include/CppUTest/CommandLineTestRunner.h:31,
from tests/testmain.cpp:15:
/usr/include/c++/4.7/new:93:7: error: from previous declaration ‘void* operator new(std::size_t)’
Удаление -std=c++11
Опция заставляет все работать снова и снова.
Документация CppUTest содержит некоторые комментарии о макросах, конфликтующих с перегруженными новыми операторами, и предлагает сначала включить стандартные заголовки, но я получаю эту проблему, вообще не включая заголовки, хотя выглядит так CppUTest/CommandLineTestRunner.h
в том числе <string>
сам.
Кто-нибудь сталкивался с этим раньше или знает, в чем проблема?