summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/reducevarscope.cxx
AgeCommit message (Collapse)Author
2022-08-08Adapt to changed clang::LambdaCapture::getCapturedVar return typeStephan Bergmann
...where <https://github.com/llvm/llvm-project/commit/127bf44385424891eb04cff8e52d3f157fc2cb7c> "[Clang][C++20] Support capturing structured bindings in lambdas" on Clang 16 trunk changed the return type from VarDecl to ValueDecl, causing > compilerplugins/clang/reducevarscope.cxx:541:26: error: no matching member function for call to 'erase' > maVarDeclMap.erase(varDecl); > ~~~~~~~~~~~~~^~~~~ > /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unordered_map.h:740:7: note: candidate function not viable: no known conversion from 'ValueDecl *' to 'const_iterator' (aka '_Node_const_iterator<std::pair<const clang::VarDecl *const, (anonymous namespace)::ReduceVarScope::DepthInfo>, __constant_iterators::value, __hash_cached::value>') for 1st argument > erase(const_iterator __position) > ^ > /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unordered_map.h:745:7: note: candidate function not viable: no known conversion from 'ValueDecl *' to 'iterator' (aka '_Node_iterator<std::pair<const clang::VarDecl *const, (anonymous namespace)::ReduceVarScope::DepthInfo>, __constant_iterators::value, __hash_cached::value>') for 1st argument > erase(iterator __position) > ^ > /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unordered_map.h:762:7: note: candidate function not viable: cannot convert from base class pointer 'ValueDecl *' to derived class pointer 'const key_type' (aka 'const clang::VarDecl *const') for 1st argument > erase(const key_type& __x) > ^ > /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unordered_map.h:780:7: note: candidate function not viable: requires 2 arguments, but 1 was provided > erase(const_iterator __first, const_iterator __last) > ^ etc. Change-Id: I79b062ca604435bc83a58eeb32df673e6c658bd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137984 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Bump compiler plugins Clang baseline to 12.0.1Stephan Bergmann
...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-10new loplugin:reducevarscopeNoel Grandin
Change-Id: Iefe922c2e0d605114d54673d63eccc5e4abd545d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>