Skip to content

Commit b022854

Browse files
committed
Addressed "extra ';'" warning with -pedantic enabled by removing all internal ;
1 parent 72f0652 commit b022854

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

ChangeLog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
2017-04-17 James J Balamuta <[email protected]>
22

3-
* inst/include/Rcpp/exceptions.h: modified exceptions macros to support
3+
* inst/include/Rcpp/Rcpp/exceptions/cpp11/exceptions.h: Removed
4+
semicolons from RCPP_ADVANCED_EXCEPTION_CLASS to quiet 'extra ;' -Wpedantic
5+
6+
* inst/include/Rcpp/exceptions.h: Modified exceptions macros to support
47
a default string and removed generated stop, warning from file.
58
* inst/include/Rcpp/Rcpp/exceptions/cpp98/exceptions.h: Contains
69
generated RCPP_ADVANCED_EXCEPTION_CLASS macro, stop & warning.

inst/NEWS.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
(James Balamuta in \ghpr{674} addressing \ghit{673}).
1616
\item Added \code{printf}-like syntax support for exception classes and
1717
variadic templating for \code{Rcpp::stop} and \code{Rcpp::warning}
18-
(James Balamuta in \ghpr{675}).
18+
(James Balamuta in \ghpr{676}).
1919
\item Exception messages have been rewritten to provide additional
20-
information. (James Balamuta in \ghpr{675}, ?? addressing \ghit{184}).
20+
information. (James Balamuta in \ghpr{676}, ?? addressing \ghit{184}).
2121
}
2222
\item Changes in Rcpp Documentation:
2323
\itemize{

inst/include/Rcpp/exceptions/cpp11/exceptions.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
namespace Rcpp {
2929

3030
#define RCPP_ADVANCED_EXCEPTION_CLASS(__CLASS__, __WHAT__) \
31-
class __CLASS__ : public std::exception{ \
31+
class __CLASS__ : public std::exception { \
3232
public: \
33-
__CLASS__( ) throw() : message( std::string(__WHAT__) + "." ){} ; \
33+
__CLASS__( ) throw() : message( std::string(__WHAT__) + "." ){} \
3434
__CLASS__( const std::string& message ) throw() : \
35-
message( std::string(__WHAT__) + ": " + message + "."){} ; \
35+
message( std::string(__WHAT__) + ": " + message + "."){} \
3636
template <typename... Args> \
3737
__CLASS__( const char* fmt, Args&&... args ) throw() : \
38-
message( tfm::format(fmt, std::forward<Args>(args)...) ){} ; \
39-
virtual ~__CLASS__() throw(){} ; \
40-
virtual const char* what() const throw() { return message.c_str() ; } \
38+
message( tfm::format(fmt, std::forward<Args>(args)... ) ){} \
39+
virtual ~__CLASS__() throw(){} \
40+
virtual const char* what() const throw() { return message.c_str(); } \
4141
private: \
42-
std::string message ; \
43-
} ;
42+
std::string message; \
43+
};
4444

4545
template <typename... Args>
4646
inline void warning(const char* fmt, Args&&... args ) {

0 commit comments

Comments
 (0)