diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-03-03 15:19:13 -0800 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2020-03-04 09:20:30 +0100 |
commit | 3a843031a5ad83a00d2603f623881cb2b2bf719d (patch) | |
tree | e41bf3bd9709fcde6adac546c900fa1752755d61 /clang/lib/AST/ASTImporter.cpp | |
parent | bca373f73fc82728a8335e7d6cd164e8747139ec (diff) | |
download | llvmorg-10.0.0-rc3.tar.gz |
PR45083: Mark statement expressions as being dependent if they appear inllvmorg-10.0.0-rc3
dependent contexts.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
(cherry picked from commit bdad0a1b79273733df9acc1be4e992fa5d70ec56)
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 1f2ce30398c9..f42361500a91 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -6724,8 +6724,9 @@ ExpectedStmt ASTNodeImporter::VisitStmtExpr(StmtExpr *E) { SourceLocation ToLParenLoc, ToRParenLoc; std::tie(ToSubStmt, ToType, ToLParenLoc, ToRParenLoc) = *Imp; - return new (Importer.getToContext()) StmtExpr( - ToSubStmt, ToType, ToLParenLoc, ToRParenLoc); + return new (Importer.getToContext()) + StmtExpr(ToSubStmt, ToType, ToLParenLoc, ToRParenLoc, + E->isInstantiationDependent()); } ExpectedStmt ASTNodeImporter::VisitUnaryOperator(UnaryOperator *E) { |