diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-02-19 17:38:24 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-02-19 20:32:00 +0100 |
commit | 38642dafb6dd4aed75d70a9409f104c856802e7b (patch) | |
tree | 562a697dd5666c1727fd0497415866c405f3c070 /compilerplugins | |
parent | 87d46dc80a607ea66e52c3dc81dea20fd4fe07f8 (diff) |
Better loplugin:unnecessaryparen check for vexing parse
Change-Id: Id7b09a8556da25b81c056d5811ba721e781682d6
Reviewed-on: https://gerrit.libreoffice.org/68025
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/unnecessaryparen.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx index a39bcc813a63..287c080afb13 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -447,8 +447,9 @@ bool UnnecessaryParen::VisitVarDecl(const VarDecl* varDecl) return true; // these two are for "parentheses were disambiguated as a function declaration [-Werror,-Wvexing-parse]" - if (isa<CXXBindTemporaryExpr>(sub) - || isa<CXXFunctionalCastExpr>(sub)) + auto const sub2 = sub->IgnoreImplicit(); + if (isa<CXXTemporaryObjectExpr>(sub2) + || isa<CXXFunctionalCastExpr>(sub2)) return true; report( |