diff options
Diffstat (limited to 'compilerplugins/clang/test/unusedvariablecheck.cxx')
-rw-r--r-- | compilerplugins/clang/test/unusedvariablecheck.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/unusedvariablecheck.cxx b/compilerplugins/clang/test/unusedvariablecheck.cxx index c5b2a04d89fe..b020fba3eb4e 100644 --- a/compilerplugins/clang/test/unusedvariablecheck.cxx +++ b/compilerplugins/clang/test/unusedvariablecheck.cxx @@ -12,17 +12,27 @@ #include <list> #include <string> #include <vector> +#include <memory> namespace { template <typename T> using Vec = std::vector<T>; } +struct S : std::unique_ptr<int> +{ + S(int* = nullptr); +}; + int main() { std::list<int> v1; // expected-error {{unused variable 'v1' [loplugin:unusedvariablecheck]}} std::string v2; // expected-error {{unused variable 'v2' [loplugin:unusedvariablecheck]}} Vec<int> v3; // expected-error {{unused variable 'v3' [loplugin:unusedvariablecheck]}} + std::unique_ptr<int> + v4; // expected-error {{unused variable 'v4' [loplugin:unusedvariablecheck]}} + S v5; // expected-error {{unused variable 'v5' [loplugin:unusedvariablecheck]}} + S v6(nullptr); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |