[llvm-bugs] [Bug 41067] New: clang_Type_visitFields documentation is misleading

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 14 08:23:48 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41067

            Bug ID: 41067
           Summary: clang_Type_visitFields documentation is misleading
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Thierry.Martinez at inria.fr
                CC: klimek at google.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

clang_Type_visitFields result is documented as follows.

| \returns a non-zero value if the traversal was terminated
| prematurely by the visitor returning \c CXFieldVisit_Break.

This documentation is misleading because clang_Type_visitFields returns a
non-zero value (true) regardless whether the traversal was terminated
prematurely or not.

The function returns zero (false) solely if its argument is not the type of a
record declaration.

It is worth noticing that the documentation suggests that the return value is
consistent with the return value of clang_visitChildren (which returns a
non-zero value only in case of interruption), while it is not in practice.

I think that it is fine to keep the inconsistency between the two functions
(for backward compatibility) as long as the return value is correctly
documented.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190314/e5d24d60/attachment.html>


More information about the llvm-bugs mailing list