[llvm-bugs] [Bug 37192] New: Typo-correction selects different class name when only template arguments are missing

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 20 19:33:53 PDT 2018


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

            Bug ID: 37192
           Summary: Typo-correction selects different class name when only
                    template arguments are missing
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: llvm-bugs at lists.llvm.org

$ cat status.cc
namespace foo {
class Status {};

template <typename T>
class StatusOr {};

}  // namespace foo

template <typename T>
using StatusOr = ::foo::StatusOr;

$ clang status.cc
status.cc:10:25: error: no type named 'StatusOr' in namespace 'foo'; did you
      mean 'Status'?
using StatusOr = ::foo::StatusOr;
                 ~~~~~~~^~~~~~~~
                        Status
status.cc:2:7: note: 'Status' declared here
class Status {};
      ^
1 error generated.


On line 10, Clang generates an error.  Instead of matching to StatusOr, the
templated class, and suggesting to add template arguments, Clang matches to
Status instead.  In fact, Status, Status1, and Status12 would be preferred over
StatusOr despite being a perfect match for StatusOr.  The other class has to be
named Statu or Status123 before it starts suggesting adding template arguments
for StatusOr.

-- 
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/20180421/284ccc89/attachment.html>


More information about the llvm-bugs mailing list