freebsd / atf

Libraries to write tests in C, C++ and shell
Other
127 stars 44 forks source link

Build failure with --enable-developer and g++ 13.2.1 #58

Closed ncopa closed 3 months ago

ncopa commented 4 months ago
$ g++ --version
g++ (Alpine 13.2.1_git20231014) 13.2.1 20231014
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
./configure --enable-developer && make
...
g++ -DHAVE_CONFIG_H -I.     -g -O2  -D_FORTIFY_SOURCE=2 -Wall -Wcast-qual -Wextra -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wswitch -Wwrite-strings -g -Werror -Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend -Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo -Wsynth -MT atf-c++/detail/auto_array_test.o -MD -MP -MF $depbase.Tpo -c -o atf-c++/detail/auto_array_test.o atf-c++/detail/auto_array_test.cpp &&\
mv -f $depbase.Tpo $depbase.Po
In file included from atf-c++/detail/auto_array_test.cpp:26:
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_scope::body() const' at atf-c++/detail/auto_array_test.cpp:102:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_scope::body() const' at atf-c++/detail/auto_array_test.cpp:100:53:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_copy::body() const' at atf-c++/detail/auto_array_test.cpp:126:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_copy::body() const' at atf-c++/detail/auto_array_test.cpp:118:54:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_copy_ref::body() const' at atf-c++/detail/auto_array_test.cpp:150:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_copy_ref::body() const' at atf-c++/detail/auto_array_test.cpp:142:54:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_release::body() const' at atf-c++/detail/auto_array_test.cpp:186:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_release::body() const' at atf-c++/detail/auto_array_test.cpp:179:40:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_reset::body() const' at atf-c++/detail/auto_array_test.cpp:212:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_reset::body() const' at atf-c++/detail/auto_array_test.cpp:202:40:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_assign::body() const' at atf-c++/detail/auto_array_test.cpp:237:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_assign::body() const' at atf-c++/detail/auto_array_test.cpp:228:54:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_assign_ref::body() const' at atf-c++/detail/auto_array_test.cpp:263:5:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_assign_ref::body() const' at atf-c++/detail/auto_array_test.cpp:254:54:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
In destructor 'atf::auto_array<T>::~auto_array() [with T = test_array]',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_access::body() const' at atf-c++/detail/auto_array_test.cpp:284:1:
./atf-c++/detail/auto_array.hpp:98:9: error: 'static void test_array::operator delete [](void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   98 |         delete [] m_ptr;
      |         ^~~~~~~~~~~~~~~
In static member function 'static void* test_array::operator new [](size_t)',
    inlined from 'virtual void {anonymous}::atfu_tc_auto_array_access::body() const' at atf-c++/detail/auto_array_test.cpp:277:49:
atf-c++/detail/auto_array_test.cpp:66:35: note: returned from 'void* operator new(std::size_t)'
   66 |         void* mem = ::operator new(size);
      |                     ~~~~~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2673: atf-c++/detail/auto_array_test.o] Error 1
make[1]: Leaving directory '/var/ncopa/src/atf'
make: *** [Makefile:1382: all] Error 2