-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I've seen this issue with gcc 13 on Ubuntu and gcc 14 on Fedora. It's likely an issue with gcc in general.
Another LLVM bug report claims it's a bug with gcc, but I'm not convinced that is the case. clang doesn't gripe about this, regardless.
g++ -std=c++11 -DHAVE_CONFIG_H -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -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 utils/optional_test-optional_test.o -MD -MP -MF utils/.deps/optional_test-optional_test.Tpo -c -o utils/optional_test-optional_test.o `test -f 'utils/optional_test.cpp' || echo './'`utils/optional_test.cpp
In file included from utils/optional_test.cpp:29:
In destructor ‘utils::optional< <template-parameter-1-1> >::~optional() [with T = {anonymous}::test_alloc]’,
inlined from ‘virtual void {anonymous}::atfu_tc_memory::body() const’ at utils/optional_test.cpp:202:5:
./utils/optional.ipp:80:9: error: ‘static void {anonymous}::test_alloc::operator delete(void*)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
80 | delete _data;
| ^~~~~~~~~~~~
In static member function ‘static void* {anonymous}::test_alloc::operator new(std::size_t)’,
inlined from ‘utils::optional< <template-parameter-1-1> >::optional(const T&) [with T = {anonymous}::test_alloc]’ at ./utils/optional.ipp:60:11,
inlined from ‘virtual void {anonymous}::atfu_tc_memory::body() const’ at utils/optional_test.cpp:186:55:
utils/optional_test.cpp:72:30: note: returned from ‘void* operator new(std::size_t)’
72 | return ::operator new(size);
| ~~~~~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:8653: utils/optional_test-optional_test.o] Error 1
References:
Metadata
Metadata
Assignees
Labels
No labels