diff --git a/infer/src/clang/CMethodProperties.ml b/infer/src/clang/CMethodProperties.ml index 161cb58a9..e6222cd75 100644 --- a/infer/src/clang/CMethodProperties.ml +++ b/infer/src/clang/CMethodProperties.ml @@ -92,6 +92,19 @@ let get_method_body method_decl = raise CFrontend_errors.Invalid_declaration +let is_cpp_lambda_call_operator meth_decl = + let open Clang_ast_t in + match meth_decl with + | CXXMethodDecl (di, _, _, _, _) -> ( + match CAst_utils.get_decl_opt di.di_parent_pointer with + | Some (Clang_ast_t.CXXRecordDecl (_, _, _, _, _, _, _, cxx_rdi)) -> + Option.is_some cxx_rdi.xrdi_lambda_call_operator + | _ -> + false ) + | _ -> + false + + let is_cpp_virtual method_decl = let open Clang_ast_t in match method_decl with diff --git a/infer/src/clang/CMethodProperties.mli b/infer/src/clang/CMethodProperties.mli index 05f1add2c..cac774f27 100644 --- a/infer/src/clang/CMethodProperties.mli +++ b/infer/src/clang/CMethodProperties.mli @@ -19,6 +19,8 @@ val get_param_decls : Clang_ast_t.decl -> Clang_ast_t.decl list val get_method_body : Clang_ast_t.decl -> Clang_ast_t.stmt option +val is_cpp_lambda_call_operator : Clang_ast_t.decl -> bool + val is_cpp_virtual : Clang_ast_t.decl -> bool val get_init_list_instrs :