Fix ambiguity in stringification

Happening when using clang and templated operators, clang cannot decide
between the operator provided by ReusableStringStream and the one provided
by the value value as both are templates. This is easily solved by calling
the operator<< through the member syntax.

Fixes #1285
This commit is contained in:
Julien Nitard
2018-05-30 21:32:59 -05:00
committed by Martin Hořeňovský
parent 021fcee636
commit 7be8a41adf
7 changed files with 54 additions and 8 deletions

View File

@@ -105,7 +105,9 @@ namespace Catch {
typename std::enable_if<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
convert(const Fake& value) {
ReusableStringStream rss;
rss << value;
// NB: call using the function-like syntax to avoid ambiguity with
// user-defined templated operator<< under clang.
rss.operator<<(value);
return rss.str();
}