diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-10 11:07:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-10 15:42:19 +0200 |
commit | 2a82ea5c04f76af330686cd31e68f6f0d628db74 (patch) | |
tree | 0585b52a7d70abfe18ae90fc7e46807d87a3539b /compilerplugins | |
parent | eaacb2eca2ffcf46306f1db83e4c5da4a102e4a9 (diff) |
Adapt to new Clang trunk -Wuninitialized-const-reference
> error: 'error' diagnostics seen but not expected:
> File compilerplugins/clang/test/unusedfields.cxx Line 143: variable 'x' is uninitialized when passed as a const reference argument here
and
> error: 'error' diagnostics seen but not expected:
> File compilerplugins/clang/test/writeonlyvars.cxx Line 93: variable 'm_bar10' is uninitialized when passed as a const reference argument here
since <https://github.com/llvm/llvm-project/commit/
170b6869b563dd3393d99f3e03d389b9058d5f24> " [Clang] Add a new warning to warn
when passing uninitialized variables as const reference parameters to a
function"
Change-Id: I27136e387f7a14fd24a3639187b668d6ed283070
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95994
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/test/unusedfields.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/test/writeonlyvars.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compilerplugins/clang/test/unusedfields.cxx b/compilerplugins/clang/test/unusedfields.cxx index 6b54b4f7acf1..42b49a5df832 100644 --- a/compilerplugins/clang/test/unusedfields.cxx +++ b/compilerplugins/clang/test/unusedfields.cxx @@ -139,7 +139,7 @@ struct Bar // check that we see writes of the LHS when calling operator<<= void bar12() { - int x; + int x = 0; m_bar12 <<= x; } }; diff --git a/compilerplugins/clang/test/writeonlyvars.cxx b/compilerplugins/clang/test/writeonlyvars.cxx index c2f78bddda88..a596c864c3a8 100644 --- a/compilerplugins/clang/test/writeonlyvars.cxx +++ b/compilerplugins/clang/test/writeonlyvars.cxx @@ -86,7 +86,7 @@ void test() // check that we see don't see writes when calling operator<<= // expected-error@+1 {{read m_bar10 [loplugin:writeonlyvars]}} - sal_Int32 m_bar10; + sal_Int32 m_bar10 = 0; // expected-error@+2 {{write any2 [loplugin:writeonlyvars]}} // expected-error@+1 {{read any2 [loplugin:writeonlyvars]}} css::uno::Any any2; |