[LLVMbugs] [Bug 22406] New: Typo correction should not lead to follow-up errors
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jan 30 08:46:35 PST 2015
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: unassignedclangbugs at nondot.org
Reporter: ted at mielczarek.org
CC: llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150130/7ef7dd0c/attachment.html>
More information about the llvm-bugs
mailing list