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

libClangSharp - some bool flags inverted #416

Closed
leweaver opened this issue Jan 31, 2023 · 0 comments · Fixed by #431
Closed

libClangSharp - some bool flags inverted #416

leweaver opened this issue Jan 31, 2023 · 0 comments · Fixed by #431

Comments

@leweaver
Copy link

leweaver commented Jan 31, 2023

There are a number of cursor properties which when accessed through libClangSharp return the inverse of what they should:

clangsharp_Cursor_getIsCopyOrMoveConstructor
clangsharp_Cursor_getIsDeleted
clangsharp_Cursor_getIsExplicitlyDefaulted

There are two more that I didn't test - but from looking at the source code look like they may also be inverted:

clangsharp_Cursor_getIsInheritingConstructor
clangsharp_Cursor_getIsDelegatingConstructor

As a test case; when inspecting the CXCursor of the constructors in the following example, the inspected properties don't match the actual signature. I've put a comment above each constructor showing what libClangSharp reports.

class SomeClass;
class MyTest {
 public:
  // libClangSharp: IsCopyOrMove = true, IsCopy = false, IsMove = false, IsDeleted = true, IsExplicitlyDefaulted = true
  explicit MyTest(std::shared_ptr<SomeClass> someClassInstance, float someFloat = {});

  // libClangSharp: IsCopyOrMove = false, IsCopy = true, IsMove = false, IsDeleted = false, IsExplicitlyDefaulted = true
  MyTest(const MyTest& other) = delete;

  // libClangSharp: IsCopyOrMove = false, IsCopy = false, IsMove = true, IsDeleted = true, IsExplicitlyDefaulted = false
  MyTest(MyTest&& other) = default;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant