Skip to content

Missing include in gtest-extra.h? #4533

Description

@FatihBAKIR

Building fmt with clang-cl currently fails for me with this error:

test/gtest-extra.h(128,49): error: use of undeclared identifier '_CRT_ASSERT'
  128 |         original_report_mode_(_CrtSetReportMode(_CRT_ASSERT, 0)) {}
      |                                                 ^
test/gtest-extra.h(131,23): error: use of undeclared identifier '_CRT_ASSERT'
  131 |     _CrtSetReportMode(_CRT_ASSERT, original_report_mode_);
      |                       ^
2 errors generated.

I see we have

#ifdef _MSC_VER
#  include <crtdbg.h>
#endif

in test/test-main.cc but no such include in format-test.cc.

Adding the include to gtest-extra.h fixes the problem

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions