From f59854e94b077630200117b390c4e943d588be31 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 11 Apr 2019 17:36:33 -0700 Subject: elog: Add noreturn attribute We need to signal to the compiler that elog() always throws. This allows the compiler to deduce that we have unreachable code after the elog() statement, instead of a assuming that it might be reachable. Change-Id: If6c41773d3a0dde94d44481ad6ecd719365c515a Signed-off-by: William A. Kennington III --- phosphor-logging/elog.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phosphor-logging/elog.hpp b/phosphor-logging/elog.hpp index 5aace07..045e99d 100644 --- a/phosphor-logging/elog.hpp +++ b/phosphor-logging/elog.hpp @@ -147,8 +147,7 @@ void commit(Entry::Level level) * @param[in] i_args - Metadata fields to be added to the journal entry */ template -void elog(Args... i_args) -{ +[[noreturn]] void elog(Args... i_args) { // Validate if the exception is derived from sdbusplus::exception. static_assert(std::is_base_of::value, "T must be a descendant of sdbusplus::exception::exception"); -- cgit v1.2.1