[clang-tools-extra] [clang-tidy] Support functional cast in bugprone-dangling-handle (PR #69067)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 17:24:07 PDT 2023


================
@@ -33,14 +33,19 @@ handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle,
 
 ast_matchers::internal::Matcher<Stmt> handleFromTemporaryValue(
     const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) {
+
+  const auto TemporaryExpr =
+      anyOf(cxxBindTemporaryExpr(),
+            cxxFunctionalCastExpr(hasCastKind(CK_ConstructorConversion),
+                                  hasSourceExpression(cxxBindTemporaryExpr())));
----------------
HerrCai0907 wrote:

Should be  `ignorePareImpCast(cxxBindTemporaryExpr)`

https://github.com/llvm/llvm-project/pull/69067


More information about the cfe-commits mailing list