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: unassignedclangb...@nondot.org
          Reporter: l...@alex.lanin.de
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to