lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master acabfbe 2/3: Use [[noreturn]] attribute in de


From: Greg Chicares
Subject: [lmi-commits] [lmi] master acabfbe 2/3: Use [[noreturn]] attribute in declarations, not definitions
Date: Thu, 6 Apr 2017 19:08:08 -0400 (EDT)

branch: master
commit acabfbee8be1f05b3bdaf8d0577eece0c5b00042
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Use [[noreturn]] attribute in declarations, not definitions
    
    This fixes multiple clang "function declared '[[noreturn]]' after its
    first declaration" errors.
---
 alert.cpp     | 2 --
 alert.hpp     | 3 +++
 alert_cli.cpp | 1 -
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/alert.cpp b/alert.cpp
index 6a06970..b7548c1 100644
--- a/alert.cpp
+++ b/alert.cpp
@@ -267,13 +267,11 @@ void test_alarum()
     alarum()         << "Test alarum()"         << LMI_FLUSH;
 }
 
-[[noreturn]]
 void test_standard_exception()
 {
     throw std::runtime_error("Test a standard exception.");
 }
 
-[[noreturn]]
 void test_arbitrary_exception()
 {
     throw "Test an arbitrary exception.";
diff --git a/alert.hpp b/alert.hpp
index 01bc65c..7ad9bc1 100644
--- a/alert.hpp
+++ b/alert.hpp
@@ -174,6 +174,7 @@ void LMI_SO safely_show_message(std::string const&);
 void status_alert         (std::string const&);
 void warning_alert        (std::string const&);
 void hobsons_choice_alert (std::string const&);
+[[noreturn]]
 void alarum_alert         (std::string const&);
 
 /// Implement this function for each platform, in a manner that should
@@ -243,7 +244,9 @@ void LMI_SO test_status();
 void LMI_SO test_warning();
 void LMI_SO test_hobsons_choice();
 void LMI_SO test_alarum();
+[[noreturn]]
 void LMI_SO test_standard_exception();
+[[noreturn]]
 void LMI_SO test_arbitrary_exception();
 void LMI_SO test_catastrophe_report();
 
diff --git a/alert_cli.cpp b/alert_cli.cpp
index c64f60e..39c4076 100644
--- a/alert_cli.cpp
+++ b/alert_cli.cpp
@@ -96,7 +96,6 @@ void hobsons_choice_alert(std::string const& s)
         }
 }
 
-[[noreturn]]
 void alarum_alert(std::string const& s)
 {
     throw std::runtime_error(s);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]