[llvm-bugs] [Bug 43808] New: Improve -Wdocumentation fix-it suggestion for multiple errors

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 25 15:50:20 PDT 2019


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

            Bug ID: 43808
           Summary: Improve -Wdocumentation fix-it suggestion for multiple
                    errors
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at alex.lanin.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Given two different mismatches of documentation and code:

    /**
      *  @param[in] arg[]       Docu_1
      *  @param[in] cnt         Docu_2
      */
    void run(const char* const arg[], int argc);


When compiling with -Weverything:

    test.cpp:2:17: warning: parameter 'arg[]' not found in the function
declaration [-Wdocumentation]
      *  @param[in] arg[]       Docu_1
                    ^~~~~
    test.cpp:2:17: note: did you mean 'argc'?
      *  @param[in] arg[]       Docu_1
                    ^~~~~
                    argc
    test.cpp:3:17: warning: parameter 'cnt' not found in the function
declaration [-Wdocumentation]
      *  @param[in] cnt         Docu_2
                ^~~


So the clang-tidy fix-it doesn't really improve the situation:

    /**
      *  @param[in] argc        Docu_1
      *  @param[in] cnt         Docu_2
      */
    void run(const char* const arg[], int argc);


Expected behavior:

   1) arg[] should be replaced by "arg" and not "argc" as it's more similar.
   2) Consequently cnt would be replaced by argc as that would be the only
possibility after (1). I guess this will work out of the box after (1).

-- 
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/20191025/ee4ecb1f/attachment-0001.html>


More information about the llvm-bugs mailing list