Skip to content

Test targets compile failed for the [-Werror=uninitialized] compile option for non MSVC compiler(gcc11.2) #36

@zxhcho

Description

@zxhcho

The default tag BUILD_TESTING is set as ON for the project, and there is an target_compile_options(msft_proxy_tests PRIVATE -Wall -Wextra -Wpedantic -Werror) in CMakeLists.txt of test for non MSVC compiler, so when I compile the code in gcc11.2, the test cases will fail for:

error: ‘p.pro::proxy<{anonymous}::TestFacade>::meta_’ is used uninitialized [-Werror=uninitialized]
[build] 323 | if (rhs.meta_ != nullptr) {
[build] | ~~~~^~~~~
proxy_lifetime_tests.cpp: In member function ‘virtual void ProxyLifetimeTests_TestMoveAssignment_FromNull_ToSelf_Test::TestBody()’:
proxy_lifetime_tests.cpp:692:26: note: ‘p’ declared here
[build] 692 | pro::proxy p;

and a lot of Werror ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbuildp3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions