Comment 5 for bug 1983852

Revision history for this message
MichaƂ Sawicz (saviq) wrote : Re: `forming offset [32, 36] is out of the bounds` error on arm64 with precompiled headers on arm64

OK got the smallest reproducer I could come up with:

cmake_pch.hxx
```cpp
/* generated by CMake */

#pragma GCC system_header
#ifdef __cplusplus
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#endif // __cplusplus
```

cmake_pch.hxx.cxx
```cpp
/* generated by CMake */
```

tmp.cpp
```cpp
class Class
{
    public:
        void member(bool) {};
};

namespace
{

struct MockClass : public Class
{
    MOCK_METHOD1(member, void(bool));
};

}

TEST(Test, tests)
{
    MockClass object;
    EXPECT_CALL(object, member(testing::_));
}
```

```
/usr/bin/g++-12 -I/usr/src/googletest/googlemock/include -O2 -std=c++20 -include cmake_pch.hxx -include cmake_pch.hxx -x c++-header -o cmake_pch.hxx.gch -c cmake_pch.hxx.cxx
/usr/bin/g++-12 -I/usr/src/googletest/googlemock/include -O2 -std=c++20 -include cmake_pch.hxx -c tmp.cpp
```

Replace with `g++-11`, and it's fine.