From 4687573a48f1148cc4efddba4f221619a6547318 Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Wed, 16 May 2018 03:34:18 -0700 Subject: [PATCH] [clang] Removes a crash when unexpected declarations are found in toplevel class declarations Reviewed By: mbouaziz Differential Revision: D8024198 fbshipit-source-id: d8611a0 --- infer/src/clang/cFrontend_decl.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infer/src/clang/cFrontend_decl.ml b/infer/src/clang/cFrontend_decl.ml index a1b0855a9..2832f04f0 100644 --- a/infer/src/clang/cFrontend_decl.ml +++ b/infer/src/clang/cFrontend_decl.ml @@ -269,8 +269,11 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron | PragmaDetectMismatchDecl _ | StaticAssertDecl _ | TranslationUnitDecl _ -> - L.die InternalError "Skipped Method Declaration '%s'." + let decl_info = Clang_ast_proj.get_decl_tuple dec in + CFrontend_config.incorrect_assumption __POS__ decl_info.Clang_ast_t.di_source_range + "Skipped declaration inside a class '%s'." (Clang_ast_proj.get_decl_kind_string dec) + dec let process_methods trans_unit_ctx tenv cfg curr_class decl_list =