From 45817bea4b0cd0d3ccdcacd7d9c247ec81f60b52 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 4 Oct 2017 11:45:28 +1300 Subject: [PATCH] Use C++11 [[noreturn]] instead of XAPIAN_NORETURN --- xapian-applications/omega/Makefile.am | 1 - xapian-applications/omega/diritor.h | 5 +-- xapian-applications/omega/expand.cc | 5 +-- xapian-core/api/compactor.cc | 7 +--- xapian-core/api/document.cc | 3 +- xapian-core/api/matchspy.cc | 3 +- xapian-core/api/omdatabase.cc | 7 ++-- xapian-core/api/replication.cc | 3 +- xapian-core/backends/flint_lock.h | 6 +-- xapian-core/backends/glass/glass_check.cc | 4 +- xapian-core/backends/glass/glass_check.h | 1 - xapian-core/backends/glass/glass_database.h | 5 +-- .../backends/glass/glass_databasereplicator.cc | 3 +- xapian-core/backends/glass/glass_postlist.cc | 3 +- xapian-core/backends/glass/glass_table.h | 7 ++-- xapian-core/backends/inmemory/inmemory_database.h | 4 +- xapian-core/backends/remote/remote-database.cc | 5 +-- xapian-core/common/Makefile.mk | 1 - xapian-core/common/io_utils.cc | 6 +-- xapian-core/common/noreturn.h | 47 ---------------------- xapian-core/docs/doxygen_source.conf.in | 1 - xapian-core/net/length.cc | 6 +-- xapian-core/net/remoteconnection.cc | 5 +-- xapian-core/net/remoteserver.cc | 3 +- xapian-core/net/serialise-error.h | 5 +-- xapian-core/net/tcpserver.cc | 4 +- .../tests/harness/backendmanager_remotetcp.cc | 3 +- xapian-core/tests/harness/testsuite.cc | 5 +-- xapian-core/tests/harness/testsuite.h | 5 +-- .../tests/harness/backendmanager_remotetcp.cc | 3 +- xapian-letor/tests/harness/testsuite.cc | 5 +-- xapian-letor/tests/harness/testsuite.h | 5 +-- 32 files changed, 46 insertions(+), 130 deletions(-) delete mode 100644 xapian-core/common/noreturn.h diff --git a/xapian-applications/omega/Makefile.am b/xapian-applications/omega/Makefile.am index 7672fafc2..3b13783a4 100644 --- a/xapian-applications/omega/Makefile.am +++ b/xapian-applications/omega/Makefile.am @@ -151,7 +151,6 @@ noinst_HEADERS +=\ common/gnu_getopt.h\ common/keyword.h\ common/msvc_dirent.h\ - common/noreturn.h\ common/omassert.h\ common/realtime.h\ common/safedirent.h\ diff --git a/xapian-applications/omega/diritor.h b/xapian-applications/omega/diritor.h index beaf2958a..1dd4eac69 100644 --- a/xapian-applications/omega/diritor.h +++ b/xapian-applications/omega/diritor.h @@ -38,8 +38,6 @@ #include #include -#include "common/noreturn.h" - #include "loadfile.h" #include "runfilter.h" // For class ReadError. @@ -120,7 +118,8 @@ class DirectoryIterator { return (entry != NULL); } - XAPIAN_NORETURN(void next_failed() const); + [[noreturn]] + void next_failed() const; const char * leafname() const { return entry->d_name; } diff --git a/xapian-applications/omega/expand.cc b/xapian-applications/omega/expand.cc index 6ff3be410..9d1a9ae6b 100644 --- a/xapian-applications/omega/expand.cc +++ b/xapian-applications/omega/expand.cc @@ -27,13 +27,10 @@ #include #include "safeerrno.h" -#include "common/noreturn.h" using namespace std; -XAPIAN_NORETURN(static void -parameter_error(const char * param, const string & scheme)); - +[[noreturn]] static void parameter_error(const char * msg, const string & scheme) { diff --git a/xapian-core/api/compactor.cc b/xapian-core/api/compactor.cc index 9c8517f34..876c36c9d 100644 --- a/xapian-core/api/compactor.cc +++ b/xapian-core/api/compactor.cc @@ -42,7 +42,6 @@ #include "backends/database.h" #include "debuglog.h" #include "leafpostlist.h" -#include "noreturn.h" #include "omassert.h" #include "filetests.h" #include "fileutils.h" @@ -96,11 +95,7 @@ Compactor::resolve_duplicate_metadata(const string & key, } -XAPIAN_NORETURN( - static void - backend_mismatch(const Xapian::Database & db, int backend1, - const string &dbpath2, int backend2) -); +[[noreturn]] static void backend_mismatch(const Xapian::Database & db, int backend1, const string &dbpath2, int backend2) diff --git a/xapian-core/api/document.cc b/xapian-core/api/document.cc index 8fb64876a..ce14b3b17 100644 --- a/xapian-core/api/document.cc +++ b/xapian-core/api/document.cc @@ -26,14 +26,13 @@ #include "backends/documentinternal.h" #include "net/serialise.h" -#include "noreturn.h" #include "str.h" #include "xapian/error.h" using namespace std; -XAPIAN_NORETURN(static void throw_invalid_arg_empty_term()); +[[noreturn]] static void throw_invalid_arg_empty_term() { diff --git a/xapian-core/api/matchspy.cc b/xapian-core/api/matchspy.cc index be702654b..182071cef 100644 --- a/xapian-core/api/matchspy.cc +++ b/xapian-core/api/matchspy.cc @@ -34,7 +34,6 @@ #include #include "debuglog.h" -#include "noreturn.h" #include "omassert.h" #include "net/length.h" #include "stringutils.h" @@ -85,7 +84,7 @@ MatchSpy::get_description() const { return "Xapian::MatchSpy()"; } -XAPIAN_NORETURN(static void unsupported_method()); +[[noreturn]] static void unsupported_method() { throw Xapian::InvalidOperationError("Method not supported for this type of termlist"); } diff --git a/xapian-core/api/omdatabase.cc b/xapian-core/api/omdatabase.cc index 84c8eda3d..04c48022e 100644 --- a/xapian-core/api/omdatabase.cc +++ b/xapian-core/api/omdatabase.cc @@ -42,7 +42,6 @@ #include "editdistance.h" #include "expand/ortermlist.h" #include "internaltypes.h" -#include "noreturn.h" #include "pack.h" #include @@ -53,19 +52,19 @@ using namespace std; using Xapian::Internal::intrusive_ptr; -XAPIAN_NORETURN(static void docid_zero_invalid()); +[[noreturn]] static void docid_zero_invalid() { throw Xapian::InvalidArgumentError("Document ID 0 is invalid"); } -XAPIAN_NORETURN(static void no_subdatabases()); +[[noreturn]] static void no_subdatabases() { throw Xapian::InvalidOperationError("No subdatabases"); } -XAPIAN_NORETURN(static void empty_metadata_key()); +[[noreturn]] static void empty_metadata_key() { throw Xapian::InvalidArgumentError("Empty metadata keys are invalid"); diff --git a/xapian-core/api/replication.cc b/xapian-core/api/replication.cc index ec380cf80..b00e914d3 100644 --- a/xapian-core/api/replication.cc +++ b/xapian-core/api/replication.cc @@ -38,7 +38,6 @@ #include "omassert.h" #include "realtime.h" #include "net/remoteconnection.h" -#include "noreturn.h" #include "replicationprotocol.h" #include "safeerrno.h" #include "safesysstat.h" @@ -60,7 +59,7 @@ using namespace Xapian; "# Do not manually edit - replication operations may regenerate this file.\n" #ifdef XAPIAN_HAS_REMOTE_BACKEND -XAPIAN_NORETURN(static void throw_connection_closed_unexpectedly()); +[[noreturn]] static void throw_connection_closed_unexpectedly() { diff --git a/xapian-core/backends/flint_lock.h b/xapian-core/backends/flint_lock.h index 95326accd..3df8213ca 100644 --- a/xapian-core/backends/flint_lock.h +++ b/xapian-core/backends/flint_lock.h @@ -30,8 +30,6 @@ # include #endif -#include "noreturn.h" - class FlintLock { std::string filename; #if defined __CYGWIN__ || defined __WIN32__ @@ -104,10 +102,10 @@ class FlintLock { void release(); /// Throw Xapian::DatabaseLockError. - XAPIAN_NORETURN( + [[noreturn]] void throw_databaselockerror(FlintLock::reason why, const std::string & db_dir, - const std::string & explanation) const); + const std::string & explanation) const; }; #endif // XAPIAN_INCLUDED_FLINT_LOCK_H diff --git a/xapian-core/backends/glass/glass_check.cc b/xapian-core/backends/glass/glass_check.cc index ab3933056..33c1c8fdc 100644 --- a/xapian-core/backends/glass/glass_check.cc +++ b/xapian-core/backends/glass/glass_check.cc @@ -136,9 +136,9 @@ void GlassTableCheck::report_block(int m, int n, const byte * p) const *out << endl; } -XAPIAN_NORETURN(static void failure(const char *msg, uint4 n, int c = 0)); +[[noreturn]] static void -failure(const char *msg, uint4 n, int c) +failure(const char *msg, uint4 n, int c = 0) { string e = "Block "; e += str(n); diff --git a/xapian-core/backends/glass/glass_check.h b/xapian-core/backends/glass/glass_check.h index 75c72eb33..c699fab7d 100644 --- a/xapian-core/backends/glass/glass_check.h +++ b/xapian-core/backends/glass/glass_check.h @@ -26,7 +26,6 @@ #define OM_HGUARD_GLASS_CHECK_H #include "glass_table.h" -#include "noreturn.h" #include #include diff --git a/xapian-core/backends/glass/glass_database.h b/xapian-core/backends/glass/glass_database.h index 0b0542c76..2f8df7cfd 100644 --- a/xapian-core/backends/glass/glass_database.h +++ b/xapian-core/backends/glass/glass_database.h @@ -41,8 +41,6 @@ #include "glass_defs.h" #include "backends/valuestats.h" -#include "noreturn.h" - #include "xapian/compactor.h" #include "xapian/constants.h" @@ -290,7 +288,8 @@ class GlassDatabase : public Xapian::Database::Internal { void readahead_for_query(const Xapian::Query &query); //@} - XAPIAN_NORETURN(void throw_termlist_table_close_exception() const); + [[noreturn]] + void throw_termlist_table_close_exception() const; int get_backend_info(string * path) const { if (path) *path = db_dir; diff --git a/xapian-core/backends/glass/glass_databasereplicator.cc b/xapian-core/backends/glass/glass_databasereplicator.cc index 49f2d2145..35523d7b4 100644 --- a/xapian-core/backends/glass/glass_databasereplicator.cc +++ b/xapian-core/backends/glass/glass_databasereplicator.cc @@ -35,7 +35,6 @@ #include "fd.h" #include "internaltypes.h" #include "io_utils.h" -#include "noreturn.h" #include "pack.h" #include "posixy_wrapper.h" #include "net/remoteconnection.h" @@ -46,7 +45,7 @@ #include -XAPIAN_NORETURN(static void throw_connection_closed_unexpectedly()); +[[noreturn]] static void throw_connection_closed_unexpectedly() { diff --git a/xapian-core/backends/glass/glass_postlist.cc b/xapian-core/backends/glass/glass_postlist.cc index 6a4fdd505..c1bed5b7e 100644 --- a/xapian-core/backends/glass/glass_postlist.cc +++ b/xapian-core/backends/glass/glass_postlist.cc @@ -27,7 +27,6 @@ #include "glass_cursor.h" #include "glass_database.h" #include "debuglog.h" -#include "noreturn.h" #include "pack.h" #include "str.h" #include "unicode/description_append.h" @@ -138,7 +137,7 @@ using Glass::PostlistChunkWriter; // Static functions /// Report an error when reading the posting list. -XAPIAN_NORETURN(static void report_read_error(const char * position)); +[[noreturn]] static void report_read_error(const char * position) { if (position == 0) { diff --git a/xapian-core/backends/glass/glass_table.h b/xapian-core/backends/glass/glass_table.h index a3d96862e..36d350e84 100644 --- a/xapian-core/backends/glass/glass_table.h +++ b/xapian-core/backends/glass/glass_table.h @@ -32,7 +32,6 @@ #include "glass_defs.h" #include "io_utils.h" -#include "noreturn.h" #include "omassert.h" #include "str.h" #include "stringutils.h" @@ -721,7 +720,8 @@ class GlassTable { } /// Throw an exception indicating that the database is closed. - XAPIAN_NORETURN(static void throw_database_closed()); + [[noreturn]] + static void throw_database_closed(); string get_path() const { return name + GLASS_TABLE_EXTENSION; @@ -733,7 +733,8 @@ class GlassTable { int delete_kt(); void read_block(uint4 n, byte *p) const; void write_block(uint4 n, const byte *p, bool appending = false) const; - XAPIAN_NORETURN(void set_overwritten() const); + [[noreturn]] + void set_overwritten() const; void block_to_cursor(Glass::Cursor *C_, int j, uint4 n) const; void alter(); void compact(byte *p); diff --git a/xapian-core/backends/inmemory/inmemory_database.h b/xapian-core/backends/inmemory/inmemory_database.h index f6e3a7b5d..168641dd8 100644 --- a/xapian-core/backends/inmemory/inmemory_database.h +++ b/xapian-core/backends/inmemory/inmemory_database.h @@ -38,7 +38,6 @@ #include "inmemory_positionlist.h" #include "internaltypes.h" #include "omassert.h" -#include "noreturn.h" using namespace std; @@ -353,7 +352,8 @@ class InMemoryDatabase : public Xapian::Database::Internal { const string & tname) const; TermList * open_allterms(const string & prefix) const; - XAPIAN_NORETURN(static void throw_database_closed()); + [[noreturn]] + static void throw_database_closed(); int get_backend_info(string * path) const { if (path) *path = string(); diff --git a/xapian-core/backends/remote/remote-database.cc b/xapian-core/backends/remote/remote-database.cc index b7d7ee9d2..ecdb80839 100644 --- a/xapian-core/backends/remote/remote-database.cc +++ b/xapian-core/backends/remote/remote-database.cc @@ -31,7 +31,6 @@ #include "backends/inmemory/inmemory_positionlist.h" #include "net_postlist.h" #include "net_termlist.h" -#include "noreturn.h" #include "remote-document.h" #include "omassert.h" #include "realtime.h" @@ -54,14 +53,14 @@ using namespace std; using Xapian::Internal::intrusive_ptr; -XAPIAN_NORETURN(static void throw_bad_message(const string & context)); +[[noreturn]] static void throw_bad_message(const string & context) { throw Xapian::NetworkError("Bad message received", context); } -XAPIAN_NORETURN(static void throw_connection_closed_unexpectedly()); +[[noreturn]] static void throw_connection_closed_unexpectedly() { diff --git a/xapian-core/common/Makefile.mk b/xapian-core/common/Makefile.mk index 9890c6eaa..2136c18fe 100644 --- a/xapian-core/common/Makefile.mk +++ b/xapian-core/common/Makefile.mk @@ -16,7 +16,6 @@ noinst_HEADERS +=\ common/keyword.h\ common/log2.h\ common/msvc_dirent.h\ - common/noreturn.h\ common/omassert.h\ common/output.h\ common/pack.h\ diff --git a/xapian-core/common/io_utils.cc b/xapian-core/common/io_utils.cc index 069a69a79..e788803c1 100644 --- a/xapian-core/common/io_utils.cc +++ b/xapian-core/common/io_utils.cc @@ -32,7 +32,6 @@ #include -#include "noreturn.h" #include "omassert.h" #include "str.h" @@ -154,10 +153,9 @@ io_write(int fd, const char * p, size_t n) } } -XAPIAN_NORETURN( - static void throw_block_error(const char * s, off_t b, int e = 0)); +[[noreturn]] static void -throw_block_error(const char * s, off_t b, int e) +throw_block_error(const char * s, off_t b, int e = 0) { std::string m = s; m += str(b); diff --git a/xapian-core/common/noreturn.h b/xapian-core/common/noreturn.h deleted file mode 100644 index 665f94bef..000000000 --- a/xapian-core/common/noreturn.h +++ /dev/null @@ -1,47 +0,0 @@ -/** @file noreturn.h - * @brief Define the XAPIAN_NORETURN macro. - */ -/* Copyright (C) 2007,2011 Olly Betts - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef XAPIAN_INCLUDED_NORETURN_H -#define XAPIAN_INCLUDED_NORETURN_H - -// The macro needs to be applied to a declaration, so use it like so: -// -// XAPIAN_NORETURN(static void throw_read_only()); -// static void -// throw_read_only() -// { -// throw Xapian::InvalidOperationError("Server is read-only"); -// } - -// Allow the user to override XAPIAN_NORETURN on the compiler command line. -#ifndef XAPIAN_NORETURN -# if defined __GNUC__ -// __attribute__((__noreturn__)) is supported by GCC 2.5 and later so there's -// no need to check the GCC version in use. -# define XAPIAN_NORETURN(D) D __attribute__((__noreturn__)) -# elif defined _MSC_VER && _MSC_VER >= 1300 -// __declspec(noreturn) appears to be supported by MSVC 7.0 and later. -# define XAPIAN_NORETURN(D) __declspec(noreturn) D -# else -# define XAPIAN_NORETURN(D) D -# endif -#endif - -#endif // XAPIAN_INCLUDED_NORETURN_H diff --git a/xapian-core/docs/doxygen_source.conf.in b/xapian-core/docs/doxygen_source.conf.in index b16c86aaa..0e5b6306a 100644 --- a/xapian-core/docs/doxygen_source.conf.in +++ b/xapian-core/docs/doxygen_source.conf.in @@ -1222,7 +1222,6 @@ PREDEFINED = DOXYGEN \ XAPIAN_DEPRECATED_CLASS_EX= \ XAPIAN_DEPRECATED(D)=D \ XAPIAN_DEPRECATED_EX(D)=D \ - XAPIAN_NORETURN(D)=D \ XAPIAN_CONST_FUNCTION= \ XAPIAN_PURE_FUNCTION= \ XAPIAN_NOEXCEPT= \ diff --git a/xapian-core/net/length.cc b/xapian-core/net/length.cc index 820ed2c63..f03066ecf 100644 --- a/xapian-core/net/length.cc +++ b/xapian-core/net/length.cc @@ -22,14 +22,11 @@ #include "length.h" -#include "noreturn.h" - -XAPIAN_NORETURN(static void throw_network_error(const char * msg)); - #ifndef XAPIAN_UNITTEST #include "xapian/error.h" +[[noreturn]] static void throw_network_error(const char * msg) { @@ -47,6 +44,7 @@ class Xapian_NetworkError { const char * get_description() const { return msg; } }; +[[noreturn]] static void throw_network_error(const char * msg) { diff --git a/xapian-core/net/remoteconnection.cc b/xapian-core/net/remoteconnection.cc index 7740f94a3..ec1d668c9 100644 --- a/xapian-core/net/remoteconnection.cc +++ b/xapian-core/net/remoteconnection.cc @@ -36,7 +36,6 @@ #include "debuglog.h" #include "fd.h" #include "filetests.h" -#include "noreturn.h" #include "omassert.h" #include "posixy_wrapper.h" #include "realtime.h" @@ -47,14 +46,14 @@ using namespace std; #define CHUNKSIZE 4096 -XAPIAN_NORETURN(static void throw_database_closed()); +[[noreturn]] static void throw_database_closed() { throw Xapian::DatabaseError("Database has been closed"); } -XAPIAN_NORETURN(static void throw_network_error_insane_message_length()); +[[noreturn]] static void throw_network_error_insane_message_length() { diff --git a/xapian-core/net/remoteserver.cc b/xapian-core/net/remoteserver.cc index b049b8b48..6b44e01d9 100644 --- a/xapian-core/net/remoteserver.cc +++ b/xapian-core/net/remoteserver.cc @@ -38,7 +38,6 @@ #include "api/msetinternal.h" #include "length.h" #include "matcher/multimatch.h" -#include "noreturn.h" #include "omassert.h" #include "realtime.h" #include "serialise.h" @@ -48,7 +47,7 @@ #include "stringutils.h" #include "weight/weightinternal.h" -XAPIAN_NORETURN(static void throw_read_only()); +[[noreturn]] static void throw_read_only() { diff --git a/xapian-core/net/serialise-error.h b/xapian-core/net/serialise-error.h index d1c34d776..a2012815f 100644 --- a/xapian-core/net/serialise-error.h +++ b/xapian-core/net/serialise-error.h @@ -22,7 +22,6 @@ #define XAPIAN_INCLUDED_SERIALISE_ERROR_H #include -#include "noreturn.h" // Forward class declarations: @@ -50,9 +49,9 @@ std::string serialise_error(const Xapian::Error &e); * context will be noted in the Error's @a msg * field. */ -XAPIAN_NORETURN( +[[noreturn]] void unserialise_error(const std::string &error_string, const std::string &prefix, - const std::string &new_context)); + const std::string &new_context); #endif diff --git a/xapian-core/net/tcpserver.cc b/xapian-core/net/tcpserver.cc index fdae95e71..100f2c6f7 100644 --- a/xapian-core/net/tcpserver.cc +++ b/xapian-core/net/tcpserver.cc @@ -31,7 +31,6 @@ #include "safenetdb.h" #include "safesyssocket.h" -#include "noreturn.h" #include "remoteconnection.h" #include "resolver.h" #include "str.h" @@ -311,8 +310,7 @@ TcpServer::run_once() extern "C" { -XAPIAN_NORETURN(static void on_SIGTERM(int /*sig*/)); - +[[noreturn]] static void on_SIGTERM(int /*sig*/) { diff --git a/xapian-core/tests/harness/backendmanager_remotetcp.cc b/xapian-core/tests/harness/backendmanager_remotetcp.cc index f8190b581..0b34c6167 100644 --- a/xapian-core/tests/harness/backendmanager_remotetcp.cc +++ b/xapian-core/tests/harness/backendmanager_remotetcp.cc @@ -48,7 +48,6 @@ # include // For free(). #endif -#include "noreturn.h" #include "str.h" #include @@ -228,7 +227,7 @@ try_next_port: #elif defined __WIN32__ -XAPIAN_NORETURN(static void win32_throw_error_string(const char * str)); +[[noreturn]] static void win32_throw_error_string(const char * str) { string msg(str); diff --git a/xapian-core/tests/harness/testsuite.cc b/xapian-core/tests/harness/testsuite.cc index ba848d9b6..c7afae12e 100644 --- a/xapian-core/tests/harness/testsuite.cc +++ b/xapian-core/tests/harness/testsuite.cc @@ -65,7 +65,6 @@ # include #endif #include "filetests.h" -#include "noreturn.h" #include "stringutils.h" using namespace std; @@ -179,7 +178,7 @@ static void * sigaddr = NULL; extern "C" { #if defined HAVE_SIGACTION && defined SA_SIGINFO -XAPIAN_NORETURN(static void handle_sig(int signum_, siginfo_t *si, void *)); +[[noreturn]] static void handle_sig(int signum_, siginfo_t *si, void *) { // Disable all our signal handlers to avoid problems if the signal @@ -206,7 +205,7 @@ static void handle_sig(int signum_, siginfo_t *si, void *) #else -XAPIAN_NORETURN(static void handle_sig(int signum_)); +[[noreturn]] static void handle_sig(int signum_) { // Disable all our signal handlers to avoid problems if the signal diff --git a/xapian-core/tests/harness/testsuite.h b/xapian-core/tests/harness/testsuite.h index 4f82ba982..61404632f 100644 --- a/xapian-core/tests/harness/testsuite.h +++ b/xapian-core/tests/harness/testsuite.h @@ -23,8 +23,6 @@ #ifndef OM_HGUARD_TESTSUITE_H #define OM_HGUARD_TESTSUITE_H -#include "noreturn.h" - #ifndef XAPIAN_UNITTEST # include "output.h" # define UNITTEST_CHECK_EXCEPTION @@ -147,7 +145,8 @@ class test_driver { */ static void parse_command_line(int argc, char **argv); - XAPIAN_NORETURN(static void usage()); + [[noreturn]] + static void usage(); static int run(const test_desc *tests); diff --git a/xapian-letor/tests/harness/backendmanager_remotetcp.cc b/xapian-letor/tests/harness/backendmanager_remotetcp.cc index cc83532bc..2f490c1a9 100644 --- a/xapian-letor/tests/harness/backendmanager_remotetcp.cc +++ b/xapian-letor/tests/harness/backendmanager_remotetcp.cc @@ -48,7 +48,6 @@ # include // For free(). #endif -#include "noreturn.h" #include "str.h" #include @@ -230,7 +229,7 @@ try_next_port: #elif defined __WIN32__ -XAPIAN_NORETURN(static void win32_throw_error_string(const char * str)); +[[noreturn]] static void win32_throw_error_string(const char * str) { string msg(str); diff --git a/xapian-letor/tests/harness/testsuite.cc b/xapian-letor/tests/harness/testsuite.cc index 9390ec22f..57e65cb61 100644 --- a/xapian-letor/tests/harness/testsuite.cc +++ b/xapian-letor/tests/harness/testsuite.cc @@ -65,7 +65,6 @@ # include #endif #include "filetests.h" -#include "noreturn.h" #include "stringutils.h" using namespace std; @@ -179,7 +178,7 @@ static void * sigaddr = NULL; extern "C" { #if defined HAVE_SIGACTION && defined SA_SIGINFO -XAPIAN_NORETURN(static void handle_sig(int signum_, siginfo_t *si, void *)); +[[noreturn]] static void handle_sig(int signum_, siginfo_t *si, void *) { // Disable all our signal handlers to avoid problems if the signal @@ -206,7 +205,7 @@ static void handle_sig(int signum_, siginfo_t *si, void *) #else -XAPIAN_NORETURN(static void handle_sig(int signum_)); +[[noreturn]] static void handle_sig(int signum_) { // Disable all our signal handlers to avoid problems if the signal diff --git a/xapian-letor/tests/harness/testsuite.h b/xapian-letor/tests/harness/testsuite.h index 4f82ba982..61404632f 100644 --- a/xapian-letor/tests/harness/testsuite.h +++ b/xapian-letor/tests/harness/testsuite.h @@ -23,8 +23,6 @@ #ifndef OM_HGUARD_TESTSUITE_H #define OM_HGUARD_TESTSUITE_H -#include "noreturn.h" - #ifndef XAPIAN_UNITTEST # include "output.h" # define UNITTEST_CHECK_EXCEPTION @@ -147,7 +145,8 @@ class test_driver { */ static void parse_command_line(int argc, char **argv); - XAPIAN_NORETURN(static void usage()); + [[noreturn]] + static void usage(); static int run(const test_desc *tests); -- 2.11.4.GIT