[llvm-bugs] [Bug 42403] New: Go to declaration broken for overloaded functions in a template

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 26 02:34:12 PDT 2019


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

            Bug ID: 42403
           Summary: Go to declaration broken for overloaded functions in a
                    template
           Product: clang-tools-extra
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: clangd
          Assignee: unassignedclangbugs at nondot.org
          Reporter: giulio at rapgenic.it
                CC: llvm-bugs at lists.llvm.org

Given the following snippet of code:


        int f(void);
        int f(int);
        int f(char);

        template<typename P>
        int funccall(P Param) {
                return f(Param);
        }

when asking clangd for the declaration of symbol f in function funccall the
answer is "No declaration found for f". The same happens with go to definition.

This somehow makes sense, because it cannot decide which one of the three
overloads is the right one.

However I think it might be a better solution in such cases to return a list of
all the possible overloads, so that the user can at least see where they are
located and choose the appropriate one on his own.

-- 
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/20190626/b9dc913c/attachment-0001.html>


More information about the llvm-bugs mailing list