diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-10-19 00:04:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-10-19 00:04:38 +0000 |
commit | 778dc0f1d49230f53401ae0c190fe460bda4ffd1 (patch) | |
tree | 52a50a471e9e8e3f7081ae3cf43994be93856d44 /clang/lib/AST/ExprConstant.cpp | |
parent | 9fdd09a4ccd01feb8e00be22b17e944e46807746 (diff) | |
download | bcm5719-llvm-778dc0f1d49230f53401ae0c190fe460bda4ffd1.tar.gz bcm5719-llvm-778dc0f1d49230f53401ae0c190fe460bda4ffd1.zip |
[c++20] Add CXXRewrittenBinaryOperator to represent a comparison
operator that is rewritten as a call to multiple other operators.
No functionality change yet: nothing creates these expressions.
llvm-svn: 375305
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index a379a335b2f..42c746e6028 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -6765,6 +6765,10 @@ public: } } + bool VisitCXXRewrittenBinaryOperator(const CXXRewrittenBinaryOperator *E) { + return StmtVisitorTy::Visit(E->getSemanticForm()); + } + bool VisitBinaryConditionalOperator(const BinaryConditionalOperator *E) { // Evaluate and cache the common expression. We treat it as a temporary, // even though it's not quite the same thing. @@ -13945,6 +13949,9 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { return CheckEvalInICE(E, Ctx); return ICEDiag(IK_NotICE, E->getBeginLoc()); } + case Expr::CXXRewrittenBinaryOperatorClass: + return CheckICE(cast<CXXRewrittenBinaryOperator>(E)->getSemanticForm(), + Ctx); case Expr::DeclRefExprClass: { if (isa<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl())) return NoDiag(); |