google / google/googletest

weird warning with mingw-gcc-12

Open
#4,072 1 comment 0 reactions 1 assignee Claimed by @derekmauro View on GitHub
bug
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

**Describe the bug**
```
[10/183] Building CXX object googlemock/CMakeFiles/gmock-matchers-misc_test.dir/test/gmock-matchers-misc_test.cc.obj
In file included from D:/a/_temp/msys64/mingw64/include/c++/12.2.0/x86_64-w64-mingw32/bits/c++allocator.h:33,
from D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/allocator.h:46,
from D:/a/_temp/msys64/mingw64/include/c++/12.2.0/deque:61,
from D:/a/googletest/googletest/googlemock/test/gmock-matchers_test.h:42,
from D:/a/googletest/googletest/googlemock/test/gmock-matchers-misc_test.cc:42:
In member function 'void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = int]',
inlined from 'static void std::allocator_traits >::deallocate(allocator_type&, pointer, size_type) [with _Tp = int]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/alloc_traits.h:496:23,
inlined from 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:[38](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:39)7:19,
inlined from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:366:15,
inlined from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:733:7,
inlined from 'testing::internal::ContainerEqMatcher >::~ContainerEqMatcher()' at D:/a/googletest/googletest/googlemock/include/gmock/gmock-matchers.h:2406:7,
inlined from 'testing::PolymorphicMatcher::type> > testing::ContainerEq(const Container&) [with Container = std::vector]' at D:/a/googletest/googletest/googlemock/include/gmock/gmock-matchers.h:4714:43,
inlined from 'virtual void testing::gmock_matchers_test::{anonymous}::ContainerEqExtraTest_MultipleValuesMissing_Test::TestBody()' at D:/a/googletest/googletest/googlemock/test/gmock-matchers-misc_test.cc:283:45:
D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/new_allocator.h:158:33: warning: 'void operator delete(void*, std::size_t)' called on pointer '' with nonzero offset [4, 9223372036854775804] [-Wfree-nonheap-object]
158 | _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
| ^
In member function '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = int]',
inlined from 'static _Tp* std::allocator_traits >::allocate(allocator_type&, size_type) [with _Tp = int]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/alloc_traits.h:464:28,
inlined from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:378:33,
inlined from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:[39](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:40)5:44,
inlined from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:332:26,
inlined from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator]' at D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/stl_vector.h:598:61,
inlined from 'static testing::internal::StlContainerView::type testing::internal::StlContainerView::Copy(const RawContainer&) [with RawContainer = std::vector]' at D:/a/googletest/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:337:60,
inlined from 'testing::internal::ContainerEqMatcher::ContainerEqMatcher(const Container&) [with Container = std::vector]' at D:/a/googletest/googletest/googlemock/include/gmock/gmock-matchers.h:2[42](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:43)0:9,
inlined from 'testing::PolymorphicMatcher::type> > testing::ContainerEq(const Container&) [with Container = std::vector]' at D:/a/googletest/googletest/googlemock/include/gmock/gmock-matchers.h:4714:[43](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:44),
inlined from 'virtual void testing::gmock_matchers_test::{anonymous}::ContainerEqExtraTest_MultipleValuesMissing_Test::TestBody()' at D:/a/googletest/googletest/googlemock/test/gmock-matchers-misc_test.cc:283:[45](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:46):
D:/a/_temp/msys64/mingw64/include/c++/12.2.0/bits/new_allocator.h:137:[55](https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313#step:4:56): note: returned from 'void* operator new(std::size_t)'
137 | return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
| ^
[11/183] Building CXX object googlemock/CMakeFiles/gmock-more-actions_test.dir/test/gmock-more-actions_test.cc.obj
[12/183] Building CXX object googlemock/CMakeFiles/gmock-nice-strict_test.dir/test/gmock-nice-strict_test.cc.obj
```

**Steps to reproduce the bug**

https://github.com/lygstate/googletest/actions/runs/3543908093/jobs/5950757313

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.