diff options
author | Samuel Benzaquen <sbenza@google.com> | 2016-06-28 14:19:41 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2016-06-28 14:19:41 +0000 |
commit | 25cd6139e3ecec7796de11b2aa9f30779f145b92 (patch) | |
tree | 1525731e6f134f7323b7adc1f484887b79d6528d /clang-tools-extra/test/clang-tidy/readability-avoid-const-params-in-decls.cpp | |
parent | 91bd7dda3af80f6d53988d494e481212f30b85b3 (diff) | |
download | bcm5719-llvm-25cd6139e3ecec7796de11b2aa9f30779f145b92.tar.gz bcm5719-llvm-25cd6139e3ecec7796de11b2aa9f30779f145b92.zip |
[clang-tidy] Do not match on lambdas.
We match on the generated FunctionDecl of the lambda and try to fix it.
This causes a crash.
The right behavior is to ignore lambdas, because they are a definition.
llvm-svn: 274019
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 | 4 |
1 files changed, 4 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 ef0f4bdded8..f009f9f5941 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 @@ -90,3 +90,7 @@ 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); + +// Regression test. We should not warn (or crash) on lambda expressions +auto lambda_with_name = [](const int n) {}; +auto lambda_without_name = [](const int) {}; |