]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3068] fix shadowed member
authorAndrei Pavel <andrei@isc.org>
Mon, 2 Oct 2023 11:33:50 +0000 (14:33 +0300)
committerAndrei Pavel <andrei@isc.org>
Thu, 5 Oct 2023 14:40:01 +0000 (17:40 +0300)
data.cc: In member function ‘virtual void isc::data::MapElement::toJSON(std::ostream&) const’:
data.cc:919:51: warning: declaration of ‘m’ shadows a member of ‘isc::data::MapElement’ [-Wshadow]
  919 |     const std::map<std::string, ConstElementPtr>& m = mapValue();
      |                                                   ^
In file included from data.cc:9:
../../../src/lib/cc/data.h:769:44: note: shadowed declaration is here
  769 |     std::map<std::string, ConstElementPtr> m;
      |                                            ^

src/lib/cc/data.cc

index 2f69f27a8cbd6b7dd943bcb90e292c4e31276508..742a99b861bf2ca089326a7ae6fbc275d706875b 100644 (file)
@@ -916,7 +916,6 @@ void
 MapElement::toJSON(std::ostream& ss) const {
     ss << "{ ";
 
-    const std::map<std::string, ConstElementPtr>& m = mapValue();
     for (auto it = m.begin(); it != m.end(); ++it) {
         if (it != m.begin()) {
             ss << ", ";