diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-21 08:27:08 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-21 13:38:45 +0000 |
| commit | f855e4845e221d8e036caa7edac9fe2926020ba4 (patch) | |
| tree | 317511a84574d9b94c4d8a006bd4ef92171ca052 /pkg/codesearch/testdata | |
| parent | 6e304df8df70bfaecd0ff91478acda0e9177f030 (diff) | |
pkg/codesearch: fix resolving of static functions declared in headers
Update #6469
Diffstat (limited to 'pkg/codesearch/testdata')
| -rw-r--r-- | pkg/codesearch/testdata/query-def-source-in-header | 8 | ||||
| -rw-r--r-- | pkg/codesearch/testdata/source0.c.json | 12 | ||||
| -rw-r--r-- | pkg/codesearch/testdata/source0.h | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/pkg/codesearch/testdata/query-def-source-in-header b/pkg/codesearch/testdata/query-def-source-in-header new file mode 100644 index 000000000..3e6fe581a --- /dev/null +++ b/pkg/codesearch/testdata/query-def-source-in-header @@ -0,0 +1,8 @@ +def-source source0.c func_in_header yes + +function func_in_header is defined in source0.h: + + 12: static inline int func_in_header() + 13: { + 14: return 0; + 15: } diff --git a/pkg/codesearch/testdata/source0.c.json b/pkg/codesearch/testdata/source0.c.json index 5eea7aba9..cb80dc021 100644 --- a/pkg/codesearch/testdata/source0.c.json +++ b/pkg/codesearch/testdata/source0.c.json @@ -13,6 +13,18 @@ }, { "kind": "function", + "name": "func_in_header", + "type": "int ()", + "is_static": true, + "body": { + "file": "source0.h", + "start_line": 12, + "end_line": 15 + }, + "comment": {} + }, + { + "kind": "function", "name": "function_with_comment_in_header", "type": "void ()", "body": { diff --git a/pkg/codesearch/testdata/source0.h b/pkg/codesearch/testdata/source0.h index 339975b2e..d1540ebce 100644 --- a/pkg/codesearch/testdata/source0.h +++ b/pkg/codesearch/testdata/source0.h @@ -8,3 +8,8 @@ void function_with_comment_in_header(); void same_name_in_several_files(); + +static inline int func_in_header() +{ + return 0; +} |
