http://llvm.org/bugs/show_bug.cgi?id=22406

            Bug ID: 22406
           Summary: Typo correction should not lead to follow-up errors
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13775
  --> http://llvm.org/bugs/attachment.cgi?id=13775&action=edit
testcase

When clang offers typo-correction suggestions, it shouldn't then give errors
because the suggestion it's offering doesn't make sense in the context it's
used in. I've seen this a number of times building Firefox when clang chooses a
bad suggestion and I then get a number of unhelpful errors.

Attached is a testcase that produces the following output:
$ clang test.c
test.c:9:7: error: use of undeclared identifier 'food'; did you mean 'foo'?
  bar(food);
      ^~~~
      foo
test.c:1:6: note: 'foo' declared here
void foo() {
     ^
test.c:9:7: warning: incompatible pointer to integer conversion passing 'void
()' to
      parameter of type 'int' [-Wint-conversion]
  bar(food);
      ^~~~
test.c:4:14: note: passing argument to parameter 'x' here
void bar(int x) {
             ^
1 warning and 1 error generated.


The "did you mean foo" suggestion is nice, but the "incompatible pointer to
integer conversion" error is not helpful and clang shouldn't do that.



I'm using the clang that came with XCode 6.1.1:
$ clang --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to