seznam / SuperiorMySqlpp

SuperiorMySQL++
GNU Lesser General Public License v3.0
31 stars 20 forks source link

Noexcept function should not throw an exception #40

Closed smradCZ closed 6 years ago

smradCZ commented 6 years ago

G++ compiler since version 6.1 contains warning in case the exception is thrown from function with noexcept specifier (see patch https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00381.html).

Current code compilation fails on Statement::close().

include/superior_mysqlpp/low_level/dbdriver.hpp: In member function ‘void SuperiorMySqlpp::LowLevel::DBDriver::Statement::close()’:
include/superior_mysqlpp/low_level/dbdriver.hpp:637:91: warning: throw will always call terminate() [-Wterminate]
                             mysql_stmt_error(statementPtr), mysql_stmt_errno(statementPtr));

The warning can be suppressed by passing -Wno-terminate to the compiler or better we should avoid throwing exception here.

smradCZ commented 6 years ago

Please close this issue, it was fixed by #45