diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-07-16 09:52:02 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-07-16 09:52:02 +0000 |
| commit | c8c90e5b40be5b482b98613b86cfc82942f630a8 (patch) | |
| tree | 6ec344c5a75be2c3cd63c848d8cb41c79859436c /clang/test | |
| parent | 0a7592b5e248ca592620e2a5307d95093dc878ef (diff) | |
| download | bcm5719-llvm-c8c90e5b40be5b482b98613b86cfc82942f630a8.tar.gz bcm5719-llvm-c8c90e5b40be5b482b98613b86cfc82942f630a8.zip | |
[Sema] Reword warning for constant captures that are not required
This is one of the darker corners of C++, make it clear that this is
about constants and rephrase it a bit.
Before: lambda capture 'i' is not required to be captured for this use
After: lambda capture of constant 'i' is not required for this use
llvm-svn: 337152
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/warn-unused-lambda-capture.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/warn-unused-lambda-capture.cpp b/clang/test/SemaCXX/warn-unused-lambda-capture.cpp index 52ec390b0bb..f1f0c9e2bc1 100644 --- a/clang/test/SemaCXX/warn-unused-lambda-capture.cpp +++ b/clang/test/SemaCXX/warn-unused-lambda-capture.cpp @@ -41,9 +41,9 @@ void test() { auto explicit_by_value_used = [i] { return i + 1; }; auto explicit_by_value_used_void = [i] { (void)i; }; auto explicit_by_value_unused = [i] {}; // expected-warning{{lambda capture 'i' is not used}} - auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; // expected-warning{{lambda capture 'i' is not required to be captured for this use}} - auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; }; // expected-warning{{lambda capture 'i' is not required to be captured for this use}} - auto explicit_by_value_unused_const = [k] { return k + 1; }; // expected-warning{{lambda capture 'k' is not required to be captured for this use}} + auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; // expected-warning{{lambda capture of constant 'i' is not required for this use}} + auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; }; // expected-warning{{lambda capture of constant 'i' is not required for this use}} + auto explicit_by_value_unused_const = [k] { return k + 1; }; // expected-warning{{lambda capture of constant 'k' is not required for this use}} auto explicit_by_reference_used = [&i] { i++; }; auto explicit_by_reference_unused = [&i] {}; // expected-warning{{lambda capture 'i' is not used}} @@ -146,10 +146,10 @@ void test_templated() { auto explicit_by_value_used_void = [i] { (void)i; }; auto explicit_by_value_unused = [i] {}; // expected-warning{{lambda capture 'i' is not used}} - auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; // expected-warning{{lambda capture 'i' is not required to be captured for this use}} + auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; // expected-warning{{lambda capture of constant 'i' is not required for this use}} auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; }; // expected-warning{{lambda capture 'i' is not used}} - auto explicit_by_value_unused_const = [k] { return k + 1; }; // expected-warning{{lambda capture 'k' is not required to be captured for this use}} - auto explicit_by_value_unused_const_generic = [k](auto c) { return k + 1; }; // expected-warning{{lambda capture 'k' is not required to be captured for this use}} + auto explicit_by_value_unused_const = [k] { return k + 1; }; // expected-warning{{lambda capture of constant 'k' is not required for this use}} + auto explicit_by_value_unused_const_generic = [k](auto c) { return k + 1; }; // expected-warning{{lambda capture of constant 'k' is not required for this use}} auto explicit_by_reference_used = [&i] { i++; }; auto explicit_by_reference_unused = [&i] {}; // expected-warning{{lambda capture 'i' is not used}} |

