summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
diff options
context:
space:
mode:
authorTyker <tyker1@outlook.com>2019-11-17 11:41:55 +0100
committerTyker <tyker1@outlook.com>2019-11-19 18:20:45 +0100
commitb0561b3346e7bf0ae974995ca95b917eebde18e1 (patch)
tree959dcae1398035f974b55bbef71fb1b81417be28 /clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
parentdd471dbe99a7e017357809151df56f2d4c3e7a31 (diff)
downloadbcm5719-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-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
index 4372e74c235..878eab8b956 100644
--- a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
@@ -202,7 +202,7 @@ void NonConstParameterCheck::markCanNotBeConst(const Expr *E,
} else if (const auto *Constr = dyn_cast<CXXConstructExpr>(E)) {
for (const auto *Arg : Constr->arguments()) {
if (const auto *M = dyn_cast<MaterializeTemporaryExpr>(Arg))
- markCanNotBeConst(cast<Expr>(M->getTemporary()), CanNotBeConst);
+ markCanNotBeConst(cast<Expr>(M->getSubExpr()), CanNotBeConst);
}
} else if (const auto *ILE = dyn_cast<InitListExpr>(E)) {
for (unsigned I = 0U; I < ILE->getNumInits(); ++I)
OpenPOWER on IntegriCloud