summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2020-03-09 17:34:33 -0700
committerHans Wennborg <hans@chromium.org>2020-03-12 12:10:24 +0100
commitd9bd6e3c1943e03b783f11d9f2e224ff83f83a7b (patch)
tree16f09db3551e9ad0ed5a7f345d319442e6efd6ce /clang/lib/Serialization/ASTWriterStmt.cpp
parent5e062819d5adeb2526f1b8393edf5a265bef1591 (diff)
downloadbcm5719-llvm-d9bd6e3c1943e03b783f11d9f2e224ff83f83a7b.tar.gz
bcm5719-llvm-d9bd6e3c1943e03b783f11d9f2e224ff83f83a7b.zip
PR45083: Mark statement expressions as being dependent if they appear in
a dependent context. This matches the GCC behavior. We track the enclosing template depth when determining whether a statement expression is within a dependent context; there doesn't appear to be any other reliable way to determine this. 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 5c845c1c50ac89a6f12557d1571678f3d1432478)
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index f81e940a6db..8519a4df019 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -1069,6 +1069,7 @@ void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
Record.AddStmt(E->getSubStmt());
Record.AddSourceLocation(E->getLParenLoc());
Record.AddSourceLocation(E->getRParenLoc());
+ Record.push_back(E->getTemplateDepth());
Code = serialization::EXPR_STMT;
}
OpenPOWER on IntegriCloud