diff options
Diffstat (limited to 'compilerplugins/clang/compat.hxx')
-rw-r--r-- | compilerplugins/clang/compat.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index ed9d3ec942dc..fb8791f978b4 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -300,6 +300,15 @@ inline clang::QualType getDeclaredReturnType(clang::FunctionDecl const * decl) { #endif } +// The isComparisonOp method on CXXOperatorCallExpr is not available yet for the clang we require +inline bool isComparisonOp(clang::CXXOperatorCallExpr const * callExpr) +{ + using namespace clang; + auto op = callExpr->getOperator(); + return op == OO_Less || op == OO_Greater || op == OO_LessEqual || op == OO_GreaterEqual + || op == OO_EqualEqual || op == OO_ExclaimEqual; +} + } #endif |