From f7409fd6ed7347b2206fe588811d06bc38e768ab Mon Sep 17 00:00:00 2001 From: Bo Rydberg <2945606+bolry@users.noreply.github.com> Date: Thu, 5 Dec 2019 10:14:58 +0100 Subject: [PATCH] Missing BOOST_NORETURN for user defined functions BOOST_NORETURN is missing for the interface of the throwning methods when BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS is defined. Without them you can get a `'noreturn' function does return` warning from g++ at `boost/container/static_vector.hpp:46:4`. --- include/boost/container/throw_exception.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/container/throw_exception.hpp b/include/boost/container/throw_exception.hpp index e09f423..59eaba6 100644 --- a/include/boost/container/throw_exception.hpp +++ b/include/boost/container/throw_exception.hpp @@ -37,15 +37,15 @@ namespace container { #if defined(BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS) //The user must provide definitions for the following functions - void throw_bad_alloc(); + BOOST_NORETURN void throw_bad_alloc(); - void throw_out_of_range(const char* str); + BOOST_NORETURN void throw_out_of_range(const char* str); - void throw_length_error(const char* str); + BOOST_NORETURN void throw_length_error(const char* str); - void throw_logic_error(const char* str); + BOOST_NORETURN void throw_logic_error(const char* str); - void throw_runtime_error(const char* str); + BOOST_NORETURN void throw_runtime_error(const char* str); #elif defined(BOOST_NO_EXCEPTIONS)