summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/default1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-22 00:20:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-22 00:20:18 +0000
commit4f4946aaaa194da6d19250e924305cf0c3f61248 (patch)
treeb5c4216243b7a0e6da67976be3051715600b73f4 /clang/test/SemaCXX/default1.cpp
parent3eeb741e6c5f72604a2f04d3548b0a95cab87fb7 (diff)
downloadbcm5719-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/SemaCXX/default1.cpp')
-rw-r--r--clang/test/SemaCXX/default1.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/default1.cpp b/clang/test/SemaCXX/default1.cpp
index 790208aa1d0..e9d8a2f767b 100644
--- a/clang/test/SemaCXX/default1.cpp
+++ b/clang/test/SemaCXX/default1.cpp
@@ -14,7 +14,8 @@ void h(int i, int j = 2, int k = 3,
int n);// expected-error {{missing default argument on parameter 'n'}}
struct S { } s;
-void i(int = s) { } // expected-error {{no viable conversion}}
+void i(int = s) { } // expected-error {{no viable conversion}} \
+// expected-note{{passing argument to parameter here}}
struct X {
X(int);
@@ -26,6 +27,8 @@ struct Y { // expected-note 2{{candidate}}
explicit Y(int);
};
-void k(Y y = 17); // expected-error{{no viable conversion}}
+void k(Y y = 17); // expected-error{{no viable conversion}} \
+// expected-note{{passing argument to parameter 'y' here}}
-void kk(Y = 17); // expected-error{{no viable conversion}}
+void kk(Y = 17); // expected-error{{no viable conversion}} \
+// expected-note{{passing argument to parameter here}}
OpenPOWER on IntegriCloud