summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2016-06-09 14:50:25 -0400
committerJoe George <joe@zeroc.com>2016-06-10 16:18:16 -0400
commit099dc25550da1e1612a6508c3e18954dbc01e6cd (patch)
tree348c81e88e50a4a84eee94672022c89ac935c5a2 /cpp/src
parentRestored serveramd on Linux/OSX (diff)
downloadice-099dc25550da1e1612a6508c3e18954dbc01e6cd.tar.bz2
ice-099dc25550da1e1612a6508c3e18954dbc01e6cd.tar.xz
ice-099dc25550da1e1612a6508c3e18954dbc01e6cd.zip
ICE-7176 - Cleanup exception dtor noexcept
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/CountDownLatch.cpp20
-rw-r--r--cpp/src/Ice/Exception.cpp63
-rw-r--r--cpp/src/IceDB/IceDB.cpp16
-rw-r--r--cpp/src/IceDB/IceDB.h12
-rw-r--r--cpp/src/IceSSL/Certificate.cpp12
-rw-r--r--cpp/src/IceStorm/Parser.cpp18
-rw-r--r--cpp/src/IceUtil/Options.cpp12
-rw-r--r--cpp/src/IceUtil/UtilException.cpp51
-rw-r--r--cpp/src/IceXML/Parser.cpp6
-rw-r--r--cpp/src/IceXML/Parser.h4
-rw-r--r--cpp/src/Slice/FileTracker.cpp4
-rw-r--r--cpp/src/Slice/FileTracker.h4
12 files changed, 140 insertions, 82 deletions
diff --git a/cpp/src/Ice/CountDownLatch.cpp b/cpp/src/Ice/CountDownLatch.cpp
index cbdd4d5bcf2..eb0422ba7e9 100644
--- a/cpp/src/Ice/CountDownLatch.cpp
+++ b/cpp/src/Ice/CountDownLatch.cpp
@@ -15,7 +15,7 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) :
{
if(count < 0)
{
- throw IceUtil::Exception(__FILE__, __LINE__);
+ throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "count must be greather than 0");
}
#ifdef _WIN32
@@ -34,12 +34,12 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) :
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc);
}
-
+
rc = pthread_cond_init(&_cond, 0);
if(rc != 0)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ }
#endif
}
@@ -60,7 +60,7 @@ IceUtilInternal::CountDownLatch::~CountDownLatch()
#endif
}
-void
+void
IceUtilInternal::CountDownLatch::await() const
{
#ifdef _WIN32
@@ -72,7 +72,7 @@ IceUtilInternal::CountDownLatch::await() const
DWORD rc = WaitForSingleObjectEx(_event, INFINITE, false);
# endif
assert(rc == WAIT_OBJECT_0 || rc == WAIT_FAILED);
-
+
if(rc == WAIT_FAILED)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError());
@@ -90,11 +90,11 @@ IceUtilInternal::CountDownLatch::await() const
}
}
unlock();
-
+
#endif
}
-void
+void
IceUtilInternal::CountDownLatch::countDown()
{
#ifdef _WIN32
@@ -129,10 +129,10 @@ IceUtilInternal::CountDownLatch::countDown()
}
}
unlock();
-
+
#else
unlock();
-
+
if(broadcast)
{
int rc = pthread_cond_broadcast(&_cond);
@@ -146,7 +146,7 @@ IceUtilInternal::CountDownLatch::countDown()
#endif
}
-int
+int
IceUtilInternal::CountDownLatch::getCount() const
{
#ifdef _WIN32
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index 0dd364ca01b..b24d64a6b53 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -102,6 +102,22 @@ throwMarshalException(const char* file, int line, const string& reason)
}
}
+namespace
+{
+
+const string __Ice__UserException_ids[] =
+{
+ "::Ice::UserException"
+};
+
+}
+
+const std::string&
+Ice::UserException::ice_staticId()
+{
+ return __Ice__UserException_ids[0];
+};
+
void
Ice::UserException::__write(::Ice::OutputStream* os) const
{
@@ -129,41 +145,54 @@ Ice::LocalException::LocalException(const char* file, int line) :
{
}
-Ice::LocalException::~LocalException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+Ice::LocalException::~LocalException() throw()
{
}
+#endif
+
+namespace
+{
+
+const string __Ice__LocalException_ids[] =
+{
+ "::Ice::LocalException"
+};
+
+}
+
+const std::string&
+Ice::LocalException::ice_staticId()
+{
+ return __Ice__LocalException_ids[0];
+}
Ice::SystemException::SystemException(const char* file, int line) :
Exception(file, line)
{
}
-Ice::SystemException::~SystemException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+Ice::SystemException::~SystemException() throw()
{
}
+#endif
-#if defined(__SUNPRO_CC)
-ostream&
-Ice::operator<<(ostream& out, const Ice::UserException& ex)
+namespace
{
- ex.ice_print(out);
- return out;
-}
-ostream&
-Ice::operator<<(ostream& out, const Ice::LocalException& ex)
+const string __Ice__SystemException_ids[] =
{
- ex.ice_print(out);
- return out;
+ "::Ice::SystemException"
+};
+
}
-ostream&
-Ice::operator<<(ostream& out, const Ice::SystemException& ex)
+const std::string&
+Ice::SystemException::ice_staticId()
{
- ex.ice_print(out);
- return out;
+ return __Ice__SystemException_ids[0];
}
-#endif
void
Ice::InitializationException::ice_print(ostream& out) const
diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp
index 0710e529cf5..85dd9b1cde2 100644
--- a/cpp/src/IceDB/IceDB.cpp
+++ b/cpp/src/IceDB/IceDB.cpp
@@ -21,9 +21,11 @@ LMDBException::LMDBException(const char* file, int line, int err) :
{
}
-LMDBException::~LMDBException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+LMDBException::~LMDBException() throw()
{
}
+#endif
string
LMDBException::ice_id() const
@@ -64,9 +66,11 @@ KeyTooLongException::KeyTooLongException(const char* file, int line, size_t size
{
}
-KeyTooLongException::~KeyTooLongException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+KeyTooLongException::~KeyTooLongException() throw()
{
}
+#endif
string
KeyTooLongException::ice_id() const
@@ -106,9 +110,11 @@ BadEnvException::BadEnvException(const char* file, int line, size_t size) :
{
}
-BadEnvException::~BadEnvException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+BadEnvException::~BadEnvException() throw()
{
}
+#endif
string
BadEnvException::ice_id() const
@@ -472,11 +478,11 @@ CursorBase::renew(const ReadOnlyTxn& txn)
//
-// On Windows, we use a default LMDB map size of 10MB, whereas on other platforms
+// On Windows, we use a default LMDB map size of 10MB, whereas on other platforms
// (Linux, OS X), we use a default of 100MB.
//
// On Windows, LMDB does not use sparse files and allocates immediately the file
-// with the given (max) size. This is why we need a fairly small default map size
+// with the given (max) size. This is why we need a fairly small default map size
// on Windows, and a larger value on other platforms.
size_t
diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h
index 2af10594176..560f96b0cee 100644
--- a/cpp/src/IceDB/IceDB.h
+++ b/cpp/src/IceDB/IceDB.h
@@ -53,7 +53,9 @@ class ICE_DB_API LMDBException : public IceUtil::Exception
public:
LMDBException(const char*, int, int);
- virtual ~LMDBException() ICE_NOEXCEPT;
+#ifndef ICE_CPP11_COMPILER
+ virtual ~LMDBException() throw();
+#endif
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
@@ -79,7 +81,9 @@ class ICE_DB_API KeyTooLongException : public IceUtil::Exception
public:
KeyTooLongException(const char*, int, size_t);
- virtual ~KeyTooLongException() ICE_NOEXCEPT;
+#ifndef ICE_CPP11_COMPILER
+ virtual ~KeyTooLongException() throw();
+#endif
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
@@ -103,7 +107,9 @@ class ICE_DB_API BadEnvException : public IceUtil::Exception
public:
BadEnvException(const char*, int, size_t);
- virtual ~BadEnvException() ICE_NOEXCEPT;
+#ifndef ICE_CPP11_COMPILER
+ virtual ~BadEnvException() throw();
+#endif
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp
index b00cb4c58ba..61597bdd0fe 100644
--- a/cpp/src/IceSSL/Certificate.cpp
+++ b/cpp/src/IceSSL/Certificate.cpp
@@ -427,9 +427,11 @@ CertificateReadException::CertificateReadException(const char* file, int line, c
{
}
-CertificateReadException::~CertificateReadException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+CertificateReadException::~CertificateReadException() throw()
{
}
+#endif
string
CertificateReadException::ice_id() const
@@ -467,9 +469,11 @@ CertificateEncodingException::CertificateEncodingException(const char* file, int
{
}
-CertificateEncodingException::~CertificateEncodingException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+CertificateEncodingException::~CertificateEncodingException() throw()
{
}
+#endif
string
CertificateEncodingException::ice_id() const
@@ -669,9 +673,11 @@ ParseException::ParseException(const char* file, int line, const string& r) :
{
}
-ParseException::~ParseException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+ParseException::~ParseException() throw()
{
}
+#endif
string
ParseException::ice_id() const
diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp
index 69624991e10..fc00848fe65 100644
--- a/cpp/src/IceStorm/Parser.cpp
+++ b/cpp/src/IceStorm/Parser.cpp
@@ -38,17 +38,19 @@ namespace
class UnknownManagerException : public Exception
{
public:
-
+
UnknownManagerException(const string& name, const char* file, int line) :
Exception(file, line),
name(name)
{
}
+#ifndef ICE_CPP11_COMPILER
virtual
- ~UnknownManagerException() ICE_NOEXCEPT
+ ~UnknownManagerException() throw()
{
}
+#endif
virtual string
ice_id() const
@@ -61,7 +63,7 @@ public:
{
return new UnknownManagerException(*this);
}
-
+
virtual void
ice_throw() const
{
@@ -157,8 +159,8 @@ Parser::link(const list<string>& args)
}
try
- {
- list<string>::const_iterator p = args.begin();
+ {
+ list<string>::const_iterator p = args.begin();
TopicPrx fromTopic = findTopic(*p++);
TopicPrx toTopic = findTopic(*p++);
@@ -182,7 +184,7 @@ Parser::unlink(const list<string>& args)
}
try
- {
+ {
list<string>::const_iterator p = args.begin();
TopicPrx fromTopic = findTopic(*p++);
@@ -405,7 +407,7 @@ Parser::showBanner()
}
//
-// With older flex version <= 2.5.35 YY_INPUT second
+// With older flex version <= 2.5.35 YY_INPUT second
// paramenter is of type int&, in newer versions it
// changes to size_t&
//
@@ -493,7 +495,7 @@ Parser::getInput(char* buf, size_t& result, size_t maxSize)
break;
}
}
-
+
result = line.length();
if(result > maxSize)
{
diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp
index ebfb3eb1208..55615665a11 100644
--- a/cpp/src/IceUtil/Options.cpp
+++ b/cpp/src/IceUtil/Options.cpp
@@ -20,9 +20,11 @@ IceUtilInternal::APIException::APIException(const char* file, int line, const st
{
}
-IceUtilInternal::APIException::~APIException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtilInternal::APIException::~APIException() throw()
{
}
+#endif
string
IceUtilInternal::APIException::ice_id() const
@@ -66,9 +68,11 @@ IceUtilInternal::BadOptException::BadOptException(const char* file, int line, co
{
}
-IceUtilInternal::BadOptException::~BadOptException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtilInternal::BadOptException::~BadOptException() throw()
{
}
+#endif
string
IceUtilInternal::BadOptException::ice_id() const
@@ -174,7 +178,7 @@ void
IceUtilInternal::Options::addOpt(const string& shortOpt, const string& longOpt, ArgType at, string dflt, RepeatType rt)
{
RecMutex::Lock sync(_m);
-
+
if(parseCalled)
{
throw APIException(__FILE__, __LINE__, "cannot add options after parse() was called");
@@ -465,7 +469,7 @@ IceUtilInternal::Options::split(const string& line)
Int64 ull = 0;
string::size_type j;
- for(j = i + 1; j < i + 3 && j < l.size() &&
+ for(j = i + 1; j < i + 3 && j < l.size() &&
isxdigit(static_cast<unsigned char>(c = l[j])); ++j)
{
ull *= 16;
diff --git a/cpp/src/IceUtil/UtilException.cpp b/cpp/src/IceUtil/UtilException.cpp
index 7a9cfb9d776..ec15dc7bff7 100644
--- a/cpp/src/IceUtil/UtilException.cpp
+++ b/cpp/src/IceUtil/UtilException.cpp
@@ -74,7 +74,7 @@ using namespace std;
namespace IceUtilInternal
{
-#ifdef NDEBUG
+#ifdef NDEBUG
bool ICE_API printStackTraces = false;
#else
bool ICE_API printStackTraces = true;
@@ -578,9 +578,11 @@ IceUtil::Exception::Exception(const char* file, int line) :
{
}
-IceUtil::Exception::~Exception() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::Exception::~Exception() throw()
{
}
+#endif
void
IceUtil::Exception::ice_print(ostream& out) const
@@ -614,12 +616,6 @@ IceUtil::Exception::what() const ICE_NOEXCEPT
return "";
}
-string
-IceUtil::Exception::ice_id() const
-{
- return "::IceUtil::Exception";
-}
-
#ifdef ICE_CPP11_MAPPING
exception_ptr
IceUtil::Exception::ice_clone() const
@@ -642,20 +638,8 @@ IceUtil::Exception::ice_name() const
{
return ice_id().substr(2);
}
-
-IceUtil::Exception*
-IceUtil::Exception::ice_clone() const
-{
- return new Exception(*this);
-}
#endif
-void
-IceUtil::Exception::ice_throw() const
-{
- throw *this;
-}
-
const char*
IceUtil::Exception::ice_file() const
{
@@ -690,9 +674,11 @@ IceUtil::NullHandleException::NullHandleException(const char* file, int line) :
}
}
-IceUtil::NullHandleException::~NullHandleException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::NullHandleException::~NullHandleException() throw()
{
}
+#endif
string
IceUtil::NullHandleException::ice_id() const
@@ -725,9 +711,11 @@ IceUtil::IllegalArgumentException::IllegalArgumentException(const char* file, in
{
}
-IceUtil::IllegalArgumentException::~IllegalArgumentException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::IllegalArgumentException::~IllegalArgumentException() throw()
{
}
+#endif
void
IceUtil::IllegalArgumentException::ice_print(ostream& out) const
@@ -775,8 +763,11 @@ IceUtil::IllegalConversionException::IllegalConversionException(const char* file
_reason(reason)
{}
-IceUtil::IllegalConversionException::~IllegalConversionException() ICE_NOEXCEPT
-{}
+#ifndef ICE_CPP11_COMPILER
+IceUtil::IllegalConversionException::~IllegalConversionException() throw()
+{
+}
+#endif
void
IceUtil::IllegalConversionException::ice_print(ostream& out) const
@@ -864,9 +855,11 @@ IceUtil::FileLockException::FileLockException(const char* file, int line, int er
{
}
-IceUtil::FileLockException::~FileLockException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::FileLockException::~FileLockException() throw()
{
}
+#endif
void
IceUtil::FileLockException::ice_print(ostream& os) const
@@ -914,9 +907,11 @@ IceUtil::OptionalNotSetException::OptionalNotSetException(const char* file, int
}
}
-IceUtil::OptionalNotSetException::~OptionalNotSetException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::OptionalNotSetException::~OptionalNotSetException() throw()
{
}
+#endif
string
IceUtil::OptionalNotSetException::ice_id() const
@@ -945,9 +940,11 @@ IceUtil::IconvInitializationException::IconvInitializationException(const char*
{
}
-IceUtil::IconvInitializationException::~IconvInitializationException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceUtil::IconvInitializationException::~IconvInitializationException() throw()
{
}
+#endif
void
IceUtil::IconvInitializationException::ice_print(ostream& out) const
diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp
index 60eb73e3c58..5cae7178956 100644
--- a/cpp/src/IceXML/Parser.cpp
+++ b/cpp/src/IceXML/Parser.cpp
@@ -28,9 +28,11 @@ IceXML::ParserException::ParserException(const char* file, int line, const strin
{
}
-IceXML::ParserException::~ParserException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+IceXML::ParserException::~ParserException() throw()
{
}
+#endif
string
IceXML::ParserException::ice_id() const
@@ -433,7 +435,7 @@ IceXML::Parser::parse(istream& in, Handler& handler)
}
if(XML_Parse(parser, buff, static_cast<int>(in.gcount()), isFinal) != 1)
{
- handler.error(XML_ErrorString(XML_GetErrorCode(parser)),
+ handler.error(XML_ErrorString(XML_GetErrorCode(parser)),
static_cast<int>(XML_GetCurrentLineNumber(parser)),
static_cast<int>(XML_GetCurrentColumnNumber(parser)));
return;
diff --git a/cpp/src/IceXML/Parser.h b/cpp/src/IceXML/Parser.h
index 366ca674d89..b44b3cac897 100644
--- a/cpp/src/IceXML/Parser.h
+++ b/cpp/src/IceXML/Parser.h
@@ -48,7 +48,9 @@ public:
ParserException(const std::string&);
ParserException(const char*, int, const std::string&);
- virtual ~ParserException() ICE_NOEXCEPT;
+#ifndef ICE_CPP11_COMPILER
+ virtual ~ParserException() throw();
+#endif
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp
index 09c14f64a34..e57de914e31 100644
--- a/cpp/src/Slice/FileTracker.cpp
+++ b/cpp/src/Slice/FileTracker.cpp
@@ -23,9 +23,11 @@ Slice::FileException::FileException(const char* file, int line, const string& r)
{
}
-Slice::FileException::~FileException() ICE_NOEXCEPT
+#ifndef ICE_CPP11_COMPILER
+Slice::FileException::~FileException() throw()
{
}
+#endif
string
Slice::FileException::ice_id() const
diff --git a/cpp/src/Slice/FileTracker.h b/cpp/src/Slice/FileTracker.h
index 1c18c97742f..1826e52a495 100644
--- a/cpp/src/Slice/FileTracker.h
+++ b/cpp/src/Slice/FileTracker.h
@@ -21,7 +21,9 @@ class FileException : public ::IceUtil::Exception
public:
FileException(const char*, int, const std::string&);
- ~FileException() ICE_NOEXCEPT;
+#ifndef ICE_CPP11_COMPILER
+ ~FileException() throw();
+#endif
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
#ifndef ICE_CPP11_MAPPING