]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Compilation fix
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 4 Jul 2011 11:59:21 +0000 (13:59 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 4 Jul 2011 11:59:21 +0000 (13:59 +0200)
Clang seems to be confused by too many templates and function
overloading, so we sacrifice little bit of convenience to make it happy.

src/lib/log/log_formatter.h
src/lib/log/tests/log_formatter_unittest.cc
src/lib/server_common/portconfig.cc

index f43e4afda62a71bd78dcc829aa930a4025868a21..11dec84332660ce88b7e9ec175887b22a0ddceaa 100644 (file)
@@ -181,19 +181,6 @@ public:
         }
         return (*this);
     }
-
-    /// \brief Exception version of arg.
-    ///
-    /// \param e An exception which the "what()" is extracted an put into the
-    ///     message.
-    Formatter& arg(const std::exception& e) {
-        if (logger_) {
-            return (arg(e.what()));
-        } else {
-            return (*this);
-        }
-    }
-
 };
 
 }
index 6fda840518236ddcd552586819ee312825d9349d..b91665dc80a8bb018dbe2d464706af53c9ed2118 100644 (file)
@@ -123,19 +123,4 @@ TEST_F(FormatterTest, noRecurse) {
     EXPECT_EQ("%1 %1", outputs[0].second);
 }
 
-// Test it can accept exceptions (which don't have a default conversion
-// to string by themself)
-TEST_F(FormatterTest, exception) {
-    class Ex : public std::exception {
-    public:
-        virtual const char* what() const throw() {
-            return "Exception test";
-        }
-    };
-    Formatter(isc::log::INFO, s("%1"), this).arg(Ex());
-    ASSERT_EQ(1, outputs.size());
-    EXPECT_EQ(isc::log::INFO, outputs[0].first);
-    EXPECT_EQ("Exception test", outputs[0].second);
-}
-
 }
index c60e18d2da8dc0ac1ff89b843623d43d96cf5d0a..379a0a17c450ca6395b354bd2a15af26e9fb39f8 100644 (file)
@@ -114,12 +114,12 @@ installListenAddresses(const AddressList& newAddresses,
          * user will get error info, command control can be used to set new
          * address. So we just catch the exception without propagating outside
          */
-        LOG_ERROR(logger, SRVCOMM_ADDRESS_FAIL).arg(e);
+        LOG_ERROR(logger, SRVCOMM_ADDRESS_FAIL).arg(e.what());
         try {
             setAddresses(service, addressStore);
         }
         catch (const exception& e2) {
-            LOG_FATAL(logger, SRVCOMM_ADDRESS_UNRECOVERABLE).arg(e2);
+            LOG_FATAL(logger, SRVCOMM_ADDRESS_UNRECOVERABLE).arg(e2.what());
         }
         //Anyway the new configure has problem, we need to notify configure
         //manager the new configure doesn't work