Skip to content

libClangSharp - some bool flags inverted #416

@leweaver

Description

@leweaver

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions