-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve diagnostic for * vs & confusion #6313
Comments
*** Bug llvm/llvm-bugzilla-archive#9555 has been marked as a duplicate of this bug. *** |
As of r158931, clang's error messages are better: $ cat tmp.cc $ ./bin/clang -fsyntax-only tmp.cc And if you change "class A;" to "class A {};": $ ./bin/clang -fsyntax-only tmp.cc The error message when A is an incomplete type could use a bit more love to make it more helpful like when A is a complete type, and there aren't any fix-it hints for any of the cases. |
Created a patch submission here: http://reviews.llvm.org/D16949 |
mentioned in issue llvm/llvm-bugzilla-archive#9555 |
…ecursive-subprogram [cherry-pick][debug-info][codegen] Prevent creation of self-referential SP node
Linked patch was committed |
@llvm/issue-subscribers-clang-codegen |
Extended Description
Consider:
class A;
void f0(A *a);
void f1(A &a);
void f2(A *a) {
f1(a);
}
void f3(A &a) {
f0(a);
}
We produce:
t.cc:7:3: error: no matching function for call to 'f1'
f1(a);
^~
t.cc:4:6: note: candidate function
void f1(A &a);
^
t.cc:11:3: error: no matching function for call to 'f0'
f0(a);
^~
t.cc:3:6: note: candidate function
void f0(A *a);
^
In addition to producing a better error message for this common issue, it would be really nice to produce a fixit that ass a & or *.
This is AKA rdar://7113438
The text was updated successfully, but these errors were encountered: