Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression] libclang no longer reports empty names for anonymous enum/struct/union #58429

Open
emilio opened this issue Oct 17, 2022 · 2 comments
Labels
clang:as-a-library libclang and C++ API

Comments

@emilio
Copy link
Contributor

emilio commented Oct 17, 2022

19e984e changed libclang behavior in a way that breaks rust-bindgen, see rust-lang/rust-bindgen#2312.

Bindgen relied on the empty name to detect anonymous records / enum / unions. Looking a bit deeper, now we don't support ancient libclang versions we could probably switch to clang_Cursor_isAnonymous and so on, but it is still probably worth flagging the behavior change in case some other code relied on that.

cc @AaronBallman

@EugeneZelenko EugeneZelenko added clang:as-a-library libclang and C++ API and removed new issue labels Oct 18, 2022
@emilio
Copy link
Contributor Author

emilio commented Oct 18, 2022

Actually let me confirm that clang_Cursor_isAnonymous is sufficient, it doesn't seem to be at a glance.

@AaronBallman
Copy link
Collaborator

Thank you for letting me know! I knew this impacted libclang when I made the changes, but I considered it a bug fix rather than a design change. If clang_Cursor_isAnonymous and clang_Cursor_isAnonymousRecordDecl do not work for you, please let me know (it'd also help to know which API you were using to get the declaration name information).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API
Projects
None yet
Development

No branches or pull requests

3 participants