[llvm-bugs] [Bug 45165] New: -Wdocumentation has false positives in template members of variadic template classes

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 10 10:01:00 PDT 2020


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

            Bug ID: 45165
           Summary: -Wdocumentation has false positives in template
                    members of variadic template classes
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: aaronpuchert at alice-dsl.net
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Running the following code with -fsyntax-only -Wdocumentation:

template<typename... Args>
struct X {
    /// @param args  Arguments.
    template<typename T>
    static int f(T t, Args... args) { return 1; }
};

void call() {
    X<>::f(1);
}

produces the warning

<source>:3:16: warning: parameter 'args' not found in the function declaration
[-Wdocumentation]
    /// @param args  Arguments.
               ^~~~
<source>:3:16: note: did you mean 't'?
    /// @param args  Arguments.
               ^~~~
               t

That's likely because the template parameter pack is empty, so in X<> the
method doesn't take any "args".

-- 
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/20200310/1edbef65/attachment.html>


More information about the llvm-bugs mailing list