message: build: workaround GCC 7.1.1 compilation issue with sanitize flags
  Version: gcc (GCC) 7.1.1 (Red Hat 7.1.1-3)
  Flags: -fsanitize=address,undefined
diff: @@ -322,16 +322,20 @@ namespace cvtest
  if (m1.size() != m2.size())
  {
  - return AssertionFailure() << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different sizes : \""
  + std::stringstream msg;
  + msg << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different sizes : \""
  << expr1 << "\" [" << PrintToString(m1.size()) << "] vs \""
  << expr2 << "\" [" << PrintToString(m2.size()) << "]";
  + return AssertionFailure() << msg.str();
  }
  if (m1.type() != m2.type())
  {
  - return AssertionFailure() << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different types : \""
  + std::stringstream msg;
  + msg << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different types : \""
  << expr1 << "\" [" << PrintToString(MatType(m1.type())) << "] vs \""
  << expr2 << "\" [" << PrintToString(MatType(m2.type())) << "]";
  + return AssertionFailure() << msg.str();
  }
  Mat diff;
  @@ -343,12 +347,14 @@ namespace cvtest
  if (maxVal > eps)
  {
  - return AssertionFailure() << "The max difference between matrices \"" << expr1 << "\" and \"" << expr2
  + std::stringstream msg;
  + msg << "The max difference between matrices \"" << expr1 << "\" and \"" << expr2
  << "\" is " << maxVal << " at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ")"
  << ", which exceeds \"" << eps_expr << "\", where \""
  << expr1 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m1, maxLoc) << ", \""
  << expr2 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m2, maxLoc) << ", \""
  << eps_expr << "\" evaluates to " << eps;
  + return AssertionFailure() << msg.str();
  }
  return AssertionSuccess();
  @@ -469,9 +475,11 @@ namespace cvtest
  {
  if (gold.size() != actual.size())
  {
  - return testing::AssertionFailure() << "KeyPoints size mistmach\n"
  + std::stringstream msg;
  + msg << "KeyPoints size mistmach\n"
  << "\"" << gold_expr << "\" : " << gold.size() << "\n"
  << "\"" << actual_expr << "\" : " << actual.size();
  + return AssertionFailure() << msg.str();
  }
  std::sort(actual.begin(), actual.end(), KeyPointLess());
  @@ -484,7 +492,8 @@ namespace cvtest
  if (!keyPointsEquals(p1, p2))
  {
  - return testing::AssertionFailure() << "KeyPoints differ at " << i << "\n"
  + std::stringstream msg;
  + msg << "KeyPoints differ at " << i << "\n"
  << "\"" << gold_expr << "\" vs \"" << actual_expr << "\" : \n"
  << "pt : " << testing::PrintToString(p1.pt) << " vs " << testing::PrintToString(p2.pt) << "\n"
  << "size : " << p1.size << " vs " << p2.size << "\n"
  @@ -492,6 +501,7 @@ namespace cvtest
  << "response : " << p1.response << " vs " << p2.response << "\n"
  << "octave : " << p1.octave << " vs " << p2.octave << "\n"
  << "class_id : " << p1.class_id << " vs " << p2.class_id;
  + return AssertionFailure() << msg.str();
  }
  }
  