diff options
author | Samuel Benzaquen <sbenza@google.com> | 2016-06-01 20:37:23 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2016-06-01 20:37:23 +0000 |
commit | aa05ae91fb7cce0cb45c2fdf74708e07bcf4cfb2 (patch) | |
tree | 3e638e93c8dc3a4b5ce02470c6bb8fdbaee582db /clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp | |
parent | 5573483c5bfff1fe65816efa34941e62998aefdb (diff) | |
download | bcm5719-llvm-aa05ae91fb7cce0cb45c2fdf74708e07bcf4cfb2.tar.gz bcm5719-llvm-aa05ae91fb7cce0cb45c2fdf74708e07bcf4cfb2.zip |
Fix uninitialized memory access when the token 'const' is not present in
the program.
If the token is not there, we still warn but we don't try to give a
fixit hint.
llvm-svn: 271426
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 | 7 |
1 files changed, 7 insertions, 0 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 aa70700c95b..ef0f4bdded8 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 @@ -83,3 +83,10 @@ void NF(const int&); void NF(const int*); void NF(const int* const*); void NF(alias_const_type); + +// Regression test for when the 'const' token is not in the code. +#define CONCAT(a, b) a##b +void ConstNotVisible(CONCAT(cons, t) int i); +// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: parameter 'i' +// We warn, but we can't give a fix +// CHECK-FIXES: void ConstNotVisible(CONCAT(cons, t) int i); |