diff options
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/AST/Stmt.cpp | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index a70b38fc902..9a4e4a2894d 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -4981,7 +4981,8 @@ Stmt *ASTNodeImporter::VisitIfStmt(IfStmt *S) { if (!ToElseStmt && S->getElse()) return nullptr; return new (Importer.getToContext()) IfStmt(Importer.getToContext(), - ToIfLoc, ToConditionVariable, + ToIfLoc, S->isConstexpr(), + ToConditionVariable, ToCondition, ToThenStmt, ToElseLoc, ToElseStmt); } diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index f514ed21f47..5f1adf7a20f 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -763,10 +763,11 @@ void MSAsmStmt::initialize(const ASTContext &C, StringRef asmstr, }); } -IfStmt::IfStmt(const ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, - Stmt *then, SourceLocation EL, Stmt *elsev) - : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL) -{ +IfStmt::IfStmt(const ASTContext &C, SourceLocation IL, bool IsConstexpr, + VarDecl *var, Expr *cond, Stmt *then, SourceLocation EL, + Stmt *elsev) + : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL) { + setConstexpr(IsConstexpr); setConditionVariable(C, var); SubExprs[COND] = cond; SubExprs[THEN] = then; |

