mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
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:

committed by
Martin Hořeňovský

parent
021fcee636
commit
7be8a41adf
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user