Hi all, I'd like to share something I believe is incorrect behavior (bug?) of find-all-symbols from the clang-include-fixer
Consider the following header (filename is Type.h) /* ----------------------------- */ #ifndef _TYPE_H #define _TYPE_H typedef struct SomeType { int a; int b; } SomeType; #endif /* ----------------------------- */ Consider, also, main.c as follows: /* ----------------------------- */ #include "Type.h" static void func( void ) { SomeType obj2; struct SomeType obj1; } /* ----------------------------- */ And finally for ease of reproduction the compile_commands.json: [ { "directory": "/home/me", "command": "/usr/bin/gcc -std=gnu90 -c /home/me/main.c", "file": "/home/me/main.c" } ] The result of running `find-all-symbols main.c` is the following --- Name: SomeType Contexts: [] FilePath: '/home/me/Type.h' Type: TypedefName Seen: 1 Used: 1 ... which appears to be missing the definition of struct SomeType Notably, if the file is parsed as c++ (eg change "gcc" to "g++" and "gnu90" to "gnu++98" above) then the result is --- Name: SomeType Contexts: [] FilePath: '/home/me/Type.h' Type: Class Seen: 1 Used: 2 ... --- Name: SomeType Contexts: [] FilePath: '/home/me/Type.h' Type: TypedefName Seen: 1 Used: 1 ... which looks ok. Is this a bug or is there something I'm missing? Kind Regards, Achilles T.
_______________________________________________ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users