<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Typo correction should not lead to follow-up errors"
   href="http://llvm.org/bugs/show_bug.cgi?id=22406">22406</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Typo correction should not lead to follow-up errors
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ted@mielczarek.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13775" name="attach_13775" title="testcase">attachment 13775</a> <a href="attachment.cgi?id=13775&action=edit" title="testcase">[details]</a></span>
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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>