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/Sema/SemaExprCXX.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/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 98af7fb73eca..705abdb4ce72 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(), + CurContext->isDependentContext()); return MaybeCreateExprWithCleanups(E); } |