mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	[Issue 2154] Correct error when building with IBM's latest XLC (#2155)
* [Issue 2154] Correct error when building with IBM's latest XLC compiler with xlclang++ front-end. On AIX, the XLC 16.1.0.1 compiler considers the call to `std::abs` ambigious, so it needs help with a static_cast to the type of the template argument. Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
		@@ -55,7 +55,8 @@ namespace {
 | 
				
			|||||||
            return lhs == rhs;
 | 
					            return lhs == rhs;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto ulpDiff = std::abs(lc - rc);
 | 
					        // static cast as a workaround for IBM XLC
 | 
				
			||||||
 | 
					        auto ulpDiff = std::abs(static_cast<FP>(lc - rc));
 | 
				
			||||||
        return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
 | 
					        return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -234,4 +235,3 @@ Floating::WithinRelMatcher WithinRel(float target) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
} // namespace Matchers
 | 
					} // namespace Matchers
 | 
				
			||||||
} // namespace Catch
 | 
					} // namespace Catch
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user