diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/Context.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Context.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/AST/ByteCode/Context.cpp b/clang/lib/AST/ByteCode/Context.cpp index aaeb52e..f7f528c 100644 --- a/clang/lib/AST/ByteCode/Context.cpp +++ b/clang/lib/AST/ByteCode/Context.cpp @@ -15,6 +15,7 @@ #include "InterpStack.h" #include "PrimType.h" #include "Program.h" +#include "clang/AST/ASTLambda.h" #include "clang/AST/Expr.h" #include "clang/Basic/TargetInfo.h" @@ -44,12 +45,12 @@ bool Context::isPotentialConstantExpr(State &Parent, const FunctionDecl *FD) { Compiler<ByteCodeEmitter>(*this, *P).compileFunc( FD, const_cast<Function *>(Func)); - ++EvalID; - // And run it. - if (!Run(Parent, Func)) + if (!Func->isValid()) return false; - return Func->isValid(); + ++EvalID; + // And run it. + return Run(Parent, Func); } void Context::isPotentialConstantExprUnevaluated(State &Parent, const Expr *E, @@ -473,7 +474,7 @@ const Function *Context::getOrCreateFunction(const FunctionDecl *FuncDecl) { IsLambdaStaticInvoker = true; const CXXRecordDecl *ClosureClass = MD->getParent(); - assert(ClosureClass->captures_begin() == ClosureClass->captures_end()); + assert(ClosureClass->captures().empty()); if (ClosureClass->isGenericLambda()) { const CXXMethodDecl *LambdaCallOp = ClosureClass->getLambdaCallOperator(); assert(MD->isFunctionTemplateSpecialization() && |