[Spice-devel] [PATCH v2 1/2] Fix clang build error on [[noreturn]]

Christophe de Dinechin christophe at dinechin.org
Tue Jul 17 15:56:14 UTC 2018


From: Christophe de Dinechin <dinechin at redhat.com>

The [[noreturn]] attribute must be visible from call sites.
This is a hard error in clang:

cursor-updater.cpp:77:3: error: function declared '[[noreturn]]' after its first declaration
[[noreturn]] void CursorUpdater::operator()()
 ^
./cursor-updater.hpp:24:10: note: declaration missing '[[noreturn]]' attribute is here
   void operator()();
        ^
1 error generated.

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 src/cursor-updater.cpp | 2 +-
 src/cursor-updater.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cursor-updater.cpp b/src/cursor-updater.cpp
index 8f65e83..9f39c7b 100644
--- a/src/cursor-updater.cpp
+++ b/src/cursor-updater.cpp
@@ -74,7 +74,7 @@ CursorUpdater::CursorUpdater(StreamPort *stream_port) : stream_port(stream_port)
     XFixesSelectCursorInput(display, DefaultRootWindow(display), XFixesDisplayCursorNotifyMask);
 }
 
-[[noreturn]] void CursorUpdater::operator()()
+void CursorUpdater::operator()()
 {
     unsigned long last_serial = 0;
 
diff --git a/src/cursor-updater.hpp b/src/cursor-updater.hpp
index d5f00af..6dbadac 100644
--- a/src/cursor-updater.hpp
+++ b/src/cursor-updater.hpp
@@ -21,7 +21,7 @@ class CursorUpdater
 public:
     CursorUpdater(StreamPort *stream_port);
 
-    void operator()();
+    [[noreturn]] void operator()();
 
 private:
     StreamPort *stream_port;
-- 
2.13.5 (Apple Git-94)



More information about the Spice-devel mailing list