diff options
author | Tyker <tyker1@outlook.com> | 2019-11-17 11:41:55 +0100 |
---|---|---|
committer | Tyker <tyker1@outlook.com> | 2019-11-19 18:20:45 +0100 |
commit | b0561b3346e7bf0ae974995ca95b917eebde18e1 (patch) | |
tree | 959dcae1398035f974b55bbef71fb1b81417be28 /clang/lib/Sema/SemaInit.cpp | |
parent | dd471dbe99a7e017357809151df56f2d4c3e7a31 (diff) | |
download | bcm5719-llvm-b0561b3346e7bf0ae974995ca95b917eebde18e1.tar.gz bcm5719-llvm-b0561b3346e7bf0ae974995ca95b917eebde18e1.zip |
[NFC] Refactor representation of materialized temporaries
Summary:
this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718
Reviewers: rsmith, martong, shafik
Reviewed By: rsmith
Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69360
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 1296e767ff0..80d7cfed711 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -6946,8 +6946,8 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path, if (auto *MTE = dyn_cast<MaterializeTemporaryExpr>(Init)) { if (Visit(Path, Local(MTE), RK)) - visitLocalsRetainedByInitializer(Path, MTE->GetTemporaryExpr(), Visit, - true, EnableLifetimeWarnings); + visitLocalsRetainedByInitializer(Path, MTE->getSubExpr(), Visit, true, + EnableLifetimeWarnings); } if (isa<CallExpr>(Init)) { @@ -7067,9 +7067,8 @@ static void visitLocalsRetainedByInitializer(IndirectLocalPath &Path, } } else if (auto *MTE = dyn_cast<MaterializeTemporaryExpr>(L)) { if (MTE->getType().isConstQualified()) - visitLocalsRetainedByInitializer(Path, MTE->GetTemporaryExpr(), - Visit, true, - EnableLifetimeWarnings); + visitLocalsRetainedByInitializer(Path, MTE->getSubExpr(), Visit, + true, EnableLifetimeWarnings); } return false; }, EnableLifetimeWarnings); |