diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-04-22 00:20:18 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-04-22 00:20:18 +0000 |
| commit | 4f4946aaaa194da6d19250e924305cf0c3f61248 (patch) | |
| tree | b5c4216243b7a0e6da67976be3051715600b73f4 /clang/test/SemaObjCXX/message.mm | |
| parent | 3eeb741e6c5f72604a2f04d3548b0a95cab87fb7 (diff) | |
| download | bcm5719-llvm-4f4946aaaa194da6d19250e924305cf0c3f61248.tar.gz bcm5719-llvm-4f4946aaaa194da6d19250e924305cf0c3f61248.zip | |
Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:
t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
type 'int *' [-pedantic]
f(long_ptr);
^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
^
llvm-svn: 102038
Diffstat (limited to 'clang/test/SemaObjCXX/message.mm')
| -rw-r--r-- | clang/test/SemaObjCXX/message.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaObjCXX/message.mm b/clang/test/SemaObjCXX/message.mm index 97ee499aff7..b75608e2327 100644 --- a/clang/test/SemaObjCXX/message.mm +++ b/clang/test/SemaObjCXX/message.mm @@ -84,9 +84,11 @@ struct MutableString : public String { }; // C++-specific parameter types @interface I5 -- method:(const String&)str1 other:(String&)str2; +- method:(const String&)str1 + other:(String&)str2; // expected-note{{passing argument to parameter 'str2' here}} @end void test_I5(I5 *i5, String s) { [i5 method:"hello" other:s]; + [i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'char const [6]'}} } |

