>From a0887988db9c379172b9bea3cdbd591276862e8d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Apr 2017 18:42:43 +0200 Subject: [PATCH 1/2] Move "noreturn" attribute to declaration from definition Use [[noreturn]] when declaring Skeleton class methods unconditionally throwing exceptions, not when defining them. --- skeleton.cpp | 2 -- skeleton.hpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/skeleton.cpp b/skeleton.cpp index bcddd1f..5bfcb07 100644 --- a/skeleton.cpp +++ b/skeleton.cpp @@ -948,13 +948,11 @@ void Skeleton::UponTestAppFatal(wxCommandEvent&) alarum() << "Test alarum() ." << LMI_FLUSH; } -[[noreturn]] void Skeleton::UponTestAppStandardException(wxCommandEvent&) { throw std::runtime_error("Test a standard exception."); } -[[noreturn]] void Skeleton::UponTestAppArbitraryException(wxCommandEvent&) { throw "Test an arbitrary exception."; diff --git a/skeleton.hpp b/skeleton.hpp index a6ef6e6..9c601a2 100644 --- a/skeleton.hpp +++ b/skeleton.hpp @@ -99,7 +99,9 @@ class Skeleton void UponTestAppWarning (wxCommandEvent&); void UponTestAppHobsons (wxCommandEvent&); void UponTestAppFatal (wxCommandEvent&); + [[noreturn]] void UponTestAppStandardException (wxCommandEvent&); + [[noreturn]] void UponTestAppArbitraryException (wxCommandEvent&); // Test alerts from shared library. -- 2.8.0.rc1