diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-10-18 02:17:18 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-10-22 14:24:01 +0200 |
commit | 80738016a36e803fe3bf8b8f6f388c6589d86a1c (patch) | |
tree | 029672918da41492eb51972aeb133fa00040b999 /bindgen/ir/comp.rs | |
parent | 0142c0aaf72a3859e319640224740965c2ddeab3 (diff) |
clang: Detect anonymous items explicitly, rather than relying on empty names.
In Clang 16, anonymous items may return names like
`(anonymous union at ..)` rather than empty names.
The right way to detect them is using clang_Cursor_isAnonymous.
Fixes #2312
Closes #2316
Co-Authored-by: Patrick Walton <pcwalton@fb.com>
Diffstat (limited to 'bindgen/ir/comp.rs')
-rw-r--r-- | bindgen/ir/comp.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bindgen/ir/comp.rs b/bindgen/ir/comp.rs index f44c5d67..039742a4 100644 --- a/bindgen/ir/comp.rs +++ b/bindgen/ir/comp.rs @@ -1422,8 +1422,7 @@ impl CompInfo { // A declaration of an union or a struct without name // could also be an unnamed field, unfortunately. - if cur.spelling().is_empty() && - cur.kind() != CXCursor_EnumDecl + if cur.is_anonymous() && cur.kind() != CXCursor_EnumDecl { let ty = cur.cur_type(); let public = cur.public_accessible(); |