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);
            ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102038 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c
index 8b577fa..9fcac25 100644
--- a/test/Sema/array-constraint.c
+++ b/test/Sema/array-constraint.c
@@ -43,7 +43,7 @@
 static int I;
 typedef int TA[I]; // expected-error {{variable length array declaration not allowed at file scope}}
 
-void strFunc(char *);
+void strFunc(char *); // expected-note{{passing argument to parameter here}}
 const char staticAry[] = "test";
 void checkStaticAry() { 
   strFunc(staticAry); // expected-warning{{passing 'char const [5]' to parameter of type 'char *' discards qualifiers}}
diff --git a/test/Sema/attr-format.c b/test/Sema/attr-format.c
index 0fadf98..a223e08 100644
--- a/test/Sema/attr-format.c
+++ b/test/Sema/attr-format.c
@@ -45,7 +45,7 @@
 // FreeBSD usage
 #define __printf0like(fmt,va) __attribute__((__format__(__printf0__,fmt,va)))
 void null(int i, const char *a, ...) __printf0like(2,0); // no-error
-void null(int i, const char *a, ...) {
+void null(int i, const char *a, ...) { // expected-note{{passing argument to parameter 'a' here}}
   if (a)
     (void)0/* vprintf(...) would go here */;
 }
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index e31cdb5..accd4ba 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -139,7 +139,7 @@
 
 enum { LESS };
 
-void foo(long (^comp)()) {
+void foo(long (^comp)()) { // expected-note{{passing argument to parameter 'comp' here}}
 }
 
 void (^test15f)(void);
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index dcc4c35..bdc2bb0 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -4,7 +4,7 @@
 typedef __typeof(sizeof(int)) size_t;
 typedef struct _FILE FILE;
 int fprintf(FILE *, const char *restrict, ...);
-int printf(const char *restrict, ...);
+int printf(const char *restrict, ...); // expected-note{{passing argument to parameter here}}
 int snprintf(char *restrict, size_t, const char *restrict, ...);
 int sprintf(char *restrict, const char *restrict, ...);
 int vasprintf(char **, const char *, va_list);
@@ -12,7 +12,7 @@
 int vfprintf(FILE *, const char *restrict, va_list);
 int vprintf(const char *restrict, va_list);
 int vsnprintf(char *, size_t, const char *, va_list);
-int vsprintf(char *restrict, const char *restrict, va_list);
+int vsprintf(char *restrict, const char *restrict, va_list); // expected-note{{passing argument to parameter here}}
 
 char * global_fmt;
 
diff --git a/test/Sema/incompatible-sign.c b/test/Sema/incompatible-sign.c
index b3c1e9a..6249feb 100644
--- a/test/Sema/incompatible-sign.c
+++ b/test/Sema/incompatible-sign.c
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 %s -verify -fsyntax-only
 
-int a(int* x);
+int a(int* x); // expected-note{{passing argument to parameter 'x' here}}
 int b(unsigned* y) { return a(y); } // expected-warning {{passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign}}
 
diff --git a/test/Sema/predefined-function.c b/test/Sema/predefined-function.c
index 74bc86f..1c40b6e 100644
--- a/test/Sema/predefined-function.c
+++ b/test/Sema/predefined-function.c
@@ -4,7 +4,8 @@
 enum Test {A=-1};
 char *funk(enum Test x);
 
-int eli(float b); // expected-note {{previous declaration is here}}
+int eli(float b); // expected-note {{previous declaration is here}} \
+// expected-note{{passing argument to parameter 'b' here}}
 int b(int c) {return 1;}
 
 int foo();
diff --git a/test/Sema/transparent-union.c b/test/Sema/transparent-union.c
index 03f6a53..cdfc850 100644
--- a/test/Sema/transparent-union.c
+++ b/test/Sema/transparent-union.c
@@ -4,7 +4,7 @@
   float *fp;
 } TU __attribute__((transparent_union));
 
-void f(TU);
+void f(TU); // expected-note{{passing argument to parameter here}}
 
 void g(int *ip, float *fp, char *cp) {
   f(ip);
diff --git a/test/Sema/vector-assign.c b/test/Sema/vector-assign.c
index e060729..05fc3b1 100644
--- a/test/Sema/vector-assign.c
+++ b/test/Sema/vector-assign.c
@@ -47,7 +47,7 @@
 typedef long long __attribute__((__vector_size__(2 * sizeof(long long))))
 longlongvec;
 
-void test3a(longlongvec *);
+void test3a(longlongvec *); // expected-note{{passing argument to parameter here}}
 void test3(const unsigned *src) {
   test3a(src);  // expected-warning {{incompatible pointer types passing 'unsigned int const *' to parameter of type 'longlongvec *'}}
 }
diff --git a/test/Sema/vector-cast.c b/test/Sema/vector-cast.c
index e655147..a717e86 100644
--- a/test/Sema/vector-cast.c
+++ b/test/Sema/vector-cast.c
@@ -30,7 +30,7 @@
 }
 
 
-void f2(t2 X);
+void f2(t2 X); // expected-note{{passing argument to parameter 'X' here}}
 
 void f3(t3 Y) {
   f2(Y);  // expected-warning {{incompatible vector types passing 't3' to parameter of type 't2'}}