Navin P | 318e1df | 2021-03-21 19:15:46 +0530 | [diff] [blame] | 1 | #include <doctest/doctest.h> |
| 2 | |
| 3 | DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN |
| 4 | #include <cstdint> |
| 5 | #include <sstream> |
| 6 | DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END |
| 7 | |
| 8 | namespace user6 { |
| 9 | struct label |
| 10 | { |
| 11 | label() |
| 12 | : i(0) {} |
| 13 | int i; |
| 14 | bool operator==(const user6::label& rhs) const { return i == rhs.i; } |
| 15 | }; |
| 16 | } // namespace user6 |
| 17 | |
| 18 | namespace user7 { |
| 19 | struct label |
| 20 | { |
| 21 | label() |
| 22 | : i(0) {} |
| 23 | int i; |
| 24 | }; |
| 25 | } // namespace user7 |
| 26 | |
| 27 | DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations") |
| 28 | DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes") |
| 29 | |
| 30 | bool operator==(const user7::label& lhs, const user7::label& rhs) { return lhs.i == rhs.i; } |
| 31 | |
| 32 | TEST_CASE("namespace 7 member vs global") { |
| 33 | user6::label a6; |
| 34 | user6::label b6; |
| 35 | |
| 36 | user7::label a7; |
| 37 | user7::label b7; |
| 38 | |
| 39 | REQUIRE(a6 == b6); |
| 40 | REQUIRE(a7 == b7); |
| 41 | } |