Use <= operator instead of ->* for decomposer
Allows more complex LHS expressions - and works around an Eclipse bug.
See Issues #359, #393 and #247 for details
diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index 5859126..7bfef0e 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -33,7 +33,7 @@
do { \
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
try { \
- ( __catchResult->*expr ).endExpression(); \
+ ( __catchResult <= expr ).endExpression(); \
} \
catch( ... ) { \
__catchResult.useActiveException( Catch::ResultDisposition::Normal ); \
diff --git a/include/internal/catch_result_builder.h b/include/internal/catch_result_builder.h
index 3963c26..b44882b 100644
--- a/include/internal/catch_result_builder.h
+++ b/include/internal/catch_result_builder.h
@@ -41,8 +41,8 @@
ResultDisposition::Flags resultDisposition );
template<typename T>
- ExpressionLhs<T const&> operator->* ( T const& operand );
- ExpressionLhs<bool> operator->* ( bool value );
+ ExpressionLhs<T const&> operator <= ( T const& operand );
+ ExpressionLhs<bool> operator <= ( bool value );
template<typename T>
ResultBuilder& operator << ( T const& value ) {
@@ -93,11 +93,11 @@
namespace Catch {
template<typename T>
- inline ExpressionLhs<T const&> ResultBuilder::operator->* ( T const& operand ) {
+ inline ExpressionLhs<T const&> ResultBuilder::operator <= ( T const& operand ) {
return ExpressionLhs<T const&>( *this, operand );
}
- inline ExpressionLhs<bool> ResultBuilder::operator->* ( bool value ) {
+ inline ExpressionLhs<bool> ResultBuilder::operator <= ( bool value ) {
return ExpressionLhs<bool>( *this, value );
}
diff --git a/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
index 9afd9bd..b64ceef 100644
--- a/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
+++ b/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
@@ -688,6 +688,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = (
"-Weverything",
+ "-Wparentheses",
"-Wno-disabled-macro-expansion",
);
};
@@ -705,6 +706,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = (
"-Weverything",
+ "-Wparentheses",
"-Wno-disabled-macro-expansion",
);
};