Skip to content

Multiple GCC warnings on TypedEq #175

@GoogleCodeExporter

Description

@GoogleCodeExporter
GCC 4.4.3 gives multiple warnings when using TypedEq with an integral type:

  gmock.h:639: warning: comparison of unsigned expression < 0 is always false

Here's a simplified example of the code that triggers the warning:

  std::size_t n = 42;
  EXPECT_THAT(n, testing::TypedEq<std::size_t>(42));

Can be trivially fixed by changing the definition of GMOCK_IS_SIGNED_ to

  #define GMOCK_IS_SIGNED_(T) (std::numeric_limits<T>::is_signed)

Original issue reported on code.google.com by [email protected] on 4 May 2015 at 11:03

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions