-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: change naming of typedef of anonymous entities to fix clang 16+
Starting from libclang 16, typedefs of anonymous entities such as typedef struct { /* ... */ } foo; will no longer have an empty name for cursor.spelling. Instead, the returned name will be cursor.type.spelling, matching the name of the typedef, i.e. "foo" in the above case. cursor.is_anonymous() will also be false for such entities, regardless of libclang version. Rather than try to coerce libclang 16 to the @anonymous_<sha1> naming convention we have, manually use the same naming for libclang 15 and earlier. It's arguably a more useful name anyway. We first have to distinguish regular anonymous entities using cursor.is_anonymous(). For libclang 15 and earlier, to distinguish from typedef of anonyous entities. For libclang 16 and later, the name will be of the form "unnamed ... at /path/to/file".
- Loading branch information
Showing
5 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters