[AL] use found_decl_ref in recently added predicates/placeholders

Reviewed By: ddino

Differential Revision: D14421509

fbshipit-source-id: 86826590b
master
David Lively 6 years ago committed by Facebook Github Bot
parent ce190547a5
commit 692a844e0c

@ -96,6 +96,7 @@ let ast_node_cxx_fully_qualified_name an =
match an with match an with
| Decl decl -> | Decl decl ->
decl_cxx_fully_qualified_name decl decl_cxx_fully_qualified_name decl
| Stmt (DeclRefExpr (_, _, _, {drti_found_decl_ref= Some dr}))
| Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) -> | Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) ->
Option.value_map ~f:decl_cxx_fully_qualified_name ~default:"" Option.value_map ~f:decl_cxx_fully_qualified_name ~default:""
(CAst_utils.get_decl dr.dr_decl_pointer) (CAst_utils.get_decl dr.dr_decl_pointer)
@ -633,6 +634,7 @@ let get_decl_ref_source_file (dr : Clang_ast_t.decl_ref) =
let get_referenced_decl_source_file an = let get_referenced_decl_source_file an =
let open Clang_ast_t in let open Clang_ast_t in
match an with match an with
| Stmt (DeclRefExpr (_, _, _, {drti_found_decl_ref= Some dr}))
| Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) -> | Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) ->
get_decl_ref_source_file dr get_decl_ref_source_file dr
| Stmt stmt -> | Stmt stmt ->

@ -12,6 +12,8 @@ codetoanalyze/cpp/linters-for-test-only/test_fully_qualified_names.cpp, Linters_
codetoanalyze/cpp/linters-for-test-only/test_fully_qualified_names.cpp, Linters_dummy_method, 39, FIND_NODES_WITH_CXX_FULL_NAME, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_fully_qualified_names.cpp, Linters_dummy_method, 39, FIND_NODES_WITH_CXX_FULL_NAME, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_included.h, Bazoo_fibble, 11, FIND_CXX_METHODS_FROM_HEADER_FILE, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_included.h, Bazoo_fibble, 11, FIND_CXX_METHODS_FROM_HEADER_FILE, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_includer.cpp, Bazowey_frazzle, 11, FIND_REF_FROM_SRC_FILE, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_includer.cpp, Bazowey_frazzle, 11, FIND_REF_FROM_SRC_FILE, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_includer.cpp, Linters_dummy_method, 15, FIND_NODES_WITH_CXX_FULL_NAME, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_includer.cpp, zowie, 18, FIND_NODES_WITH_CXX_FULL_NAME, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, B_bar, 16, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, B_bar, 16, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, B_foo, 14, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, B_foo, 14, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, []
codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, Foo::Bar::SvIf_async_tm_poke, 36, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, [] codetoanalyze/cpp/linters-for-test-only/test_overrides.cpp, Foo::Bar::SvIf_async_tm_poke, 36, FIND_CXX_METHOD_OVERRIDES, no_bucket, WARNING, []

@ -10,3 +10,5 @@
struct Bazoo { struct Bazoo {
void fibble(); void fibble();
}; };
void rabble();

@ -10,3 +10,9 @@
struct Bazowey { struct Bazowey {
void frazzle() { Bazoo().fibble(); } void frazzle() { Bazoo().fibble(); }
}; };
namespace Foo {
using ::rabble;
} // namespace Foo
void zowie() { Foo::rabble(); }

Loading…
Cancel
Save