From a4859ceae5fab9bd8a3355fa0afb393b833fa7f7 Mon Sep 17 00:00:00 2001 From: Hallucino Date: Thu, 9 Jul 2015 11:35:09 +0200 Subject: [PATCH] Fix errors to support Xcode --- include/tclap/Arg.h | 2 +- include/tclap/ArgException.h | 6 +----- include/tclap/ArgTraits.h | 1 - include/tclap/CmdLine.h | 4 ++-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index b28eef1..24d5f21 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -214,7 +214,7 @@ class Arg * The char used as a place holder when SwitchArgs are combined. * Currently set to the bell char (ASCII 7). */ - static char blankChar() { return (char)7; } + static char blankChar() { return static_cast(7); } /** * The char that indicates the beginning of a flag. Defaults to '-', but diff --git a/include/tclap/ArgException.h b/include/tclap/ArgException.h index 3411aa9..b09bc1e 100644 --- a/include/tclap/ArgException.h +++ b/include/tclap/ArgException.h @@ -53,10 +53,6 @@ class ArgException : public std::exception _typeDescription(td) { } - /** - * Destructor. - */ - virtual ~ArgException() throw() { } /** * Returns the error text. @@ -77,7 +73,7 @@ class ArgException : public std::exception /** * Returns the arg id and error text. */ - const char* what() const throw() + const char* what() const noexcept { static std::string ex; ex = _argId + " -- " + _errorText; diff --git a/include/tclap/ArgTraits.h b/include/tclap/ArgTraits.h index df1fe50..2bd176a 100644 --- a/include/tclap/ArgTraits.h +++ b/include/tclap/ArgTraits.h @@ -37,7 +37,6 @@ namespace TCLAP { */ struct ValueLike { typedef ValueLike ValueCategory; - virtual ~ValueLike() {} }; /** diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index aabe3a2..d38319c 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -137,7 +137,7 @@ class CmdLine : public CmdLineInterface /** * Throws an exception listing the missing args. */ - void missingArgsException(); + [[ noreturn ]] void missingArgsException(); /** * Checks whether a name/flag string matches entirely matches @@ -533,7 +533,7 @@ inline bool CmdLine::_emptyCombined(const std::string& s) return true; } -inline void CmdLine::missingArgsException() +[[ noreturn ]] inline void CmdLine::missingArgsException() { int count = 0;