i have a problem regarding including gtest header into my programm. The following code compiles as long as the gtest header is commented out, as soon as the header is pulled, the compiler throws an error:
#include "gtest/gtest.h"
#include <queue>
#include <nlohmann/json.hpp>
struct Data {};
nlohmann::json &operator<<(nlohmann::json &json, const Data &) {
return json;
}
template <typename T_data>
class Buffer{
public:
Buffer(){};
void FlushBuffer(){
nlohmann::json out_json;
out_json[0] << record_;
};
private:
T_data record_;
};
class LineRingBufferTest : public Buffer<Data> {
public:
LineRingBufferTest() : Buffer<Data>(){
Buffer<Data>::FlushBuffer();
}
};
Tested with gcc 12.2 / clang 1:11.0-51+nmu5 on (docker gcc:12.2-bullseye)
Thrown error is:
/usr/local/include/c++/12.2.0/type_traits:1135:52: note: 'std::__is_complete_or_unbounded<__type_identity<testing::internal::Secret> >((std::__type_identity<testing::internal::Secret>(), std::__type_identity<testing::internal::Secret>()))' evaluates to false
...
/usr/local/include/c++/12.2.0/type_traits:980:52: error: static assertion failed: template argument must be a complete class or an unbounded array
I have no clue what exactly is going on here. Thanks a lot in advance.
This was GoogeTest issue. It was fixed today here.
Try to update GoogeTest
mainbranch.