[llvm-bugs] [Bug 26641] New: Spell checking makes diagnostic worse when forgetting template parameters on a template

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 16 13:12:25 PST 2016


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

            Bug ID: 26641
           Summary: Spell checking makes diagnostic worse when forgetting
                    template parameters on a template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

This is is a good experience:

$ cat test.cc
#include <vector>

void f() {
  std::vector v;
}
$ clang -c test.cc
test.cc:4:8: error: use of class template 'std::vector' requires template
arguments
  std::vector v;
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:477:29:
note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY vector
                            ^
1 error generated.



This isn't:

$ cat test.cc
#include <ratio>
#include <vector>

void f() {
  std::vector v;
}
$ clang -c test.cc
test.cc:5:8: error: no type named 'vector' in namespace 'std'; did you mean
'hecto'?
  std::vector v;
  ~~~~~^~~~~~
       hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio:265:43:
note: 'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
1 error generated.



We probably should prefer the original diagnostic if there's a template with an
edit distance of 0 that's just missing the type parameters.

-- 
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/20160216/19ba456f/attachment.html>


More information about the llvm-bugs mailing list