Add tests for #1403

This commit is contained in:
Martin Hořeňovský 2018-10-13 14:43:58 +02:00
parent 6cede0101a
commit aaaac35d92
7 changed files with 75 additions and 10 deletions

View file

@ -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