summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.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/Sema/SemaExprCXX.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/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 98af7fb73ec..e97171b6334 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -6800,8 +6800,9 @@ Stmt *Sema::MaybeCreateStmtWithCleanups(Stmt *SubStmt) {
// a new AsmStmtWithTemporaries.
CompoundStmt *CompStmt = CompoundStmt::Create(
Context, SubStmt, SourceLocation(), SourceLocation());
- Expr *E = new (Context) StmtExpr(CompStmt, Context.VoidTy, SourceLocation(),
- SourceLocation());
+ Expr *E = new (Context)
+ StmtExpr(CompStmt, Context.VoidTy, SourceLocation(), SourceLocation(),
+ /*FIXME TemplateDepth=*/0);
return MaybeCreateExprWithCleanups(E);
}
OpenPOWER on IntegriCloud