blob: cfc2131bc4f2a997201bea1ff1a43a900f38e7d5 [file] [log] [blame]
Navin P318e1df2021-03-21 19:15:46 +05301#include <doctest/doctest.h>
2
3DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
4#include <cstdint>
5#include <sstream>
6DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
7
8namespace user6 {
9struct label
10{
11 label()
12 : i(0) {}
13 int i;
14 friend bool operator==(const user6::label& lhs, const user6::label& rhs) {
15 return lhs.i == rhs.i;
16 }
17};
18} // namespace user6
19
20namespace user8 {
21struct label
22{
23 label()
24 : i(0) {}
25 int i;
26};
27} // namespace user8
28
29
30DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations")
31DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes")
32
33bool operator==(const user8::label& lhs, const user8::label& rhs) { return lhs.i == rhs.i; }
34
35
36TEST_CASE("namespace 8 friend vs global") {
37 user6::label a6;
38 user6::label b6;
39
40 user8::label a8;
41 user8::label b8;
42
43 REQUIRE(a6 == b6);
44 REQUIRE(a8 == b8);
45}