diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-24 17:45:39 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-24 17:45:39 +0000 |
commit | 9edd2c8a2ff6c6326ff2d5b081929e4baaa798ed (patch) | |
tree | e95e0bec7923cd1a42c1c40faea72f100b97140c /test/Sema/warn-documentation.cpp | |
parent | be3ace834ee7438915e73d2115365d57d03ceb99 (diff) |
Comment diagnostics: for unresolved parameters, do not suggest parameter fixit
with parameter that is documented.
Fixes PR13670, <rdar://problem/12155840>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/warn-documentation.cpp')
-rw-r--r-- | test/Sema/warn-documentation.cpp | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index 43143ff83d..80880d453a 100644 --- a/test/Sema/warn-documentation.cpp +++ b/test/Sema/warn-documentation.cpp @@ -218,9 +218,32 @@ int test_param12(int a); /// \param aab Blah blah. int test_param13(int aaa, int bbb); +// expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}} +/// \param aaa Blah blah. +/// \param aab Blah blah. +int test_param14(int aaa, int bbb); + // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} /// \param aab Blah blah. -int test_param14(int bbb, int ccc); +int test_param15(int bbb, int ccc); + +// expected-warning@+1 {{parameter 'aab' not found in the function declaration}} +/// \param aab Ccc. +/// \param aaa Aaa. +/// \param bbb Bbb. +int test_param16(int aaa, int bbb); + +// expected-warning@+2 {{parameter 'aab' not found in the function declaration}} +/// \param aaa Aaa. +/// \param aab Ccc. +/// \param bbb Bbb. +int test_param17(int aaa, int bbb); + +// expected-warning@+3 {{parameter 'aab' not found in the function declaration}} +/// \param aaa Aaa. +/// \param bbb Bbb. +/// \param aab Ccc. +int test_param18(int aaa, int bbb); class C { // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} @@ -229,50 +252,51 @@ class C { // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} /// \param aaa Blah blah. - int test_param15(int bbb, int ccc); + int test_param19(int bbb, int ccc); }; // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} /// \param aab Blah blah. template<typename T> -void test_param16(int bbb, int ccc); +void test_param20(int bbb, int ccc); // expected-warning@+3 {{parameter 'a' is already documented}} // expected-note@+1 {{previous documentation}} /// \param a Aaa. /// \param a Aaa. -int test_param17(int a); +int test_param21(int a); // expected-warning@+4 {{parameter 'x2' is already documented}} // expected-note@+2 {{previous documentation}} /// \param x1 Aaa. /// \param x2 Bbb. /// \param x2 Ccc. -int test_param18(int x1, int x2, int x3); +int test_param22(int x1, int x2, int x3); -// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} /// \param aaa Meow. /// \param bbb Bbb. /// \returns aaa. -typedef int test_param19(int aaa); +typedef int test_param23(int aaa, int ccc); -// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} /// \param aaa Meow. /// \param bbb Bbb. /// \returns aaa. -typedef int (*test_param20)(int aaa); +typedef int (*test_param24)(int aaa, int ccc); -// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} /// \param aaa Meow. /// \param bbb Bbb. /// \returns aaa. -typedef int (* const test_param21)(int aaa); +typedef int (* const test_param25)(int aaa, int ccc); -// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'aaa'?}} +// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} /// \param aaa Meow. /// \param bbb Bbb. /// \returns aaa. -typedef int (C::*test_param22)(int aaa); +typedef int (C::*test_param26)(int aaa, int ccc); + // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} /// \tparam T Aaa |