diff options
| author | Martin Hořeňovský | 2018-10-13 14:43:58 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-10-13 16:53:30 +0200 |
| commit | aaaac35d928289b67f9b0774d29fb783fef82216 (patch) | |
| tree | 71c6ae91ad90de1d79c29be278719bdcf0b6921f /projects/SelfTest/UsageTests/Compilation.tests.cpp | |
| parent | 6cede0101ada18017c817e1afa68a4835f785e0c (diff) | |
| download | catch3-aaaac35d928289b67f9b0774d29fb783fef82216.tar.gz | |
Add tests for #1403
Diffstat (limited to 'projects/SelfTest/UsageTests/Compilation.tests.cpp')
| -rw-r--r-- | projects/SelfTest/UsageTests/Compilation.tests.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/projects/SelfTest/UsageTests/Compilation.tests.cpp b/projects/SelfTest/UsageTests/Compilation.tests.cpp index 2e518ef2..91b65ca1 100644 --- a/projects/SelfTest/UsageTests/Compilation.tests.cpp +++ b/projects/SelfTest/UsageTests/Compilation.tests.cpp @@ -5,6 +5,27 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ +// Setup for #1403 -- look for global overloads of operator << for classes +// in a different namespace. + +#include <ostream> + + + +namespace foo { + struct helper_1403 { + bool operator==(helper_1403) const { return true; } + }; +} + +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wmissing-declarations" +#endif +std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { + return out << "[1403 helper]"; +} +/////////////////////////////// + #include "catch.hpp" #include <cstring> @@ -153,5 +174,12 @@ namespace { namespace CompilationTests { TEST_CASE_METHOD((Fixture_1245<int, int>), "#1245", "[compilation]") { SUCCEED(); } - + + TEST_CASE("#1403", "[compilation]") { + ::foo::helper_1403 h1, h2; + REQUIRE(h1 == h2); + } + }} // namespace CompilationTests + + |