compilerplugins/clang/finalclasses.cxx | 2 +- compilerplugins/clang/mergeclasses.cxx | 2 +- compilerplugins/clang/methodcycles.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit c99107f6700287fda2be3c7321613cd68b7c404c Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Jan 15 23:12:25 2020 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Jan 16 08:54:07 2020 +0100 -Werror,-Wrange-loop-analysis > compilerplugins/clang/finalclasses.cxx:56:57: error: loop variable 's' has type 'const std::pair<std::string, std::string> &' (aka 'const pair<basic_string<char>, basic_string<char> > &') but is initialized with type 'std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' resulting in a copy [-Werror,-Wrange-loop-analysis] > for (const std::pair<std::string,std::string> & s : definitionMap) > ^ > compilerplugins/clang/finalclasses.cxx:56:14: note: use non-reference type 'std::pair<std::string, std::string>' (aka 'pair<basic_string<char>, basic_string<char> >') to keep the copy or type 'const std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > &' to prevent copying > for (const std::pair<std::string,std::string> & s : definitionMap) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ etc. Change-Id: If3f0599ef79d49e4bb4bbd245ca7456c09d13975 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86893 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/finalclasses.cxx b/compilerplugins/clang/finalclasses.cxx index 10948790697f..d906c586d1a0 100644 --- a/compilerplugins/clang/finalclasses.cxx +++ b/compilerplugins/clang/finalclasses.cxx @@ -53,7 +53,7 @@ public: std::string output; for (const std::string & s : inheritedFromSet) output += "inherited-from:\t" + s + "\n"; - for (const std::pair<std::string,std::string> & s : definitionMap) + for (const auto & s : definitionMap) output += "definition:\t" + s.first + "\t" + s.second + "\n"; std::ofstream myfile; myfile.open( WORKDIR "/loplugin.finalclasses.log", std::ios::app | std::ios::out); diff --git a/compilerplugins/clang/mergeclasses.cxx b/compilerplugins/clang/mergeclasses.cxx index b3a167ff143e..c7f9a6094a14 100644 --- a/compilerplugins/clang/mergeclasses.cxx +++ b/compilerplugins/clang/mergeclasses.cxx @@ -64,7 +64,7 @@ public: output += "instantiated:\t" + s + "\n"; for (const std::pair<std::string,std::string> & s : childToParentClassSet) output += "has-subclass:\t" + s.first + "\t" + s.second + "\n"; - for (const std::pair<std::string,std::string> & s : definitionMap) + for (const auto & s : definitionMap) output += "definition:\t" + s.first + "\t" + s.second + "\n"; std::ofstream myfile; myfile.open( WORKDIR "/loplugin.mergeclasses.log", std::ios::app | std::ios::out); diff --git a/compilerplugins/clang/methodcycles.cxx b/compilerplugins/clang/methodcycles.cxx index 42e15c91024a..7fd74b10d9ea 100644 --- a/compilerplugins/clang/methodcycles.cxx +++ b/compilerplugins/clang/methodcycles.cxx @@ -80,7 +80,7 @@ public: for (const MyFuncInfo& s : definitionSet) output += "definition:\t" + s.returnType + "\t" + s.nameAndParams + "\t" + s.sourceLocation + "\n"; - for (const std::pair<const FunctionDecl*, const FunctionDecl*>& pair : callMap) + for (const auto& pair : callMap) { if (!isLocationMine(pair.first->getLocation()) || !isLocationMine(pair.second->getLocation())) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits