diff options
author | Matthias Gehre <M.Gehre@gmx.de> | 2016-04-12 05:45:13 +0000 |
---|---|---|
committer | Matthias Gehre <M.Gehre@gmx.de> | 2016-04-12 05:45:13 +0000 |
commit | 018c1d424392f5da8dd982f3f410152fa0460eb1 (patch) | |
tree | 66441e23a6b0ff115378afa1ab319e55b638618d /clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp | |
parent | c27d8d8fd801e141d4c3ead53627f0579384bdb8 (diff) | |
download | bcm5719-llvm-018c1d424392f5da8dd982f3f410152fa0460eb1.tar.gz bcm5719-llvm-018c1d424392f5da8dd982f3f410152fa0460eb1.zip |
[clang-tidy] fix readability-avoid-const-params-in-decls creating invalid code in fix-its
Summary:
The Fix-Its for the added test cases were before:
-void F11(const unsigned int /*version*/);
+void F11(unsigned int int /*version*/);
-void F12(const bool b = true);
+void F12(_Bool true);
Reviewers: fowles, hokein, sbenza, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18993
llvm-svn: 266044
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp b/clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp index 4bf8456e142..aa70700c95b 100644 --- a/clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp @@ -10,7 +10,7 @@ void F1(const int i); void F2(const int *const i); // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: parameter 'i' is const-qualified -// CHECK-FIXES: void F2(const int * i); +// CHECK-FIXES: void F2(const int *i); void F3(int const i); // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: parameter 'i' is const-qualified @@ -26,7 +26,7 @@ void F5(const int); void F6(const int *const); // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: parameter 1 is const-qualified -// BUG(b/27584482): void F6(const int *); should be produced +// CHECK-FIXES: void F6(const int *); void F7(int, const int); // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: parameter 2 is const-qualified @@ -43,8 +43,15 @@ void F9(const int long_name); void F10(const int *const *const long_name); // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: parameter 'long_name' -// CHECK-FIXES: void F10(const int *const * long_name); +// CHECK-FIXES: void F10(const int *const *long_name); +void F11(const unsigned int /*v*/); +// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: parameter 1 +// CHECK-FIXES: void F11(unsigned int /*v*/); + +void F12(const bool b = true); +// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: parameter 'b' +// CHECK-FIXES: void F12(bool b = true); struct Foo { Foo(const int i); |