]> Savannah Git Hosting - gnulib.git/commitdiff
_Noreturn: clang and MSVC do support [[noreturn]] in C++11 mode.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Mar 2019 21:02:38 +0000 (22:02 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Mar 2019 21:02:38 +0000 (22:02 +0100)
* lib/_Noreturn.h: Use [[noreturn]] if __GNUC__ and __GNUC_MINOR__
indicate clang, or if _MSC_VER indicates MSVC++ 14.0 or newer.

ChangeLog
lib/_Noreturn.h
m4/gnulib-common.m4

index 81e37104868d700adcf124ce34ea64e48e64c530..02bed463abf189ceefcfe41f813e3f9dfcfa2647 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-18  Bruno Haible  <bruno@clisp.org>
+
+       _Noreturn: clang and MSVC do support [[noreturn]] in C++11 mode.
+       * lib/_Noreturn.h: Use [[noreturn]] if __GNUC__ and __GNUC_MINOR__
+       indicate clang, or if _MSC_VER indicates MSVC++ 14.0 or newer.
+
 2019-03-17  Akim Demaille  <akim@lrde.epita.fr>
 
        _Noreturn: GCC 4.7 does not support [[noreturn]] in C++11 mode
index 19597e0bf310cf9a2624efed008dbc9bc5b15ac9..1629cef39b592422a90ebc5635dab9258faee3d1 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _Noreturn
-# if (201103 <= (defined __cplusplus ? __cplusplus : 0) \
-      && (!defined __GNUC__ || 4 < __GNUC__ + (8 <= __GNUC_MINOR__)))
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)))
 #  define _Noreturn [[noreturn]]
 # elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
         || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
index 688a1e59e812c762c35711f5a88e80f362c6ef0e..20666a552a03015bdf4299169c34ea297f0b3579 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 42
+# gnulib-common.m4 serial 43
 dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,8 +17,9 @@ AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
 #ifndef _Noreturn
-# if (201103 <= (defined __cplusplus ? __cplusplus : 0) \
-      && (!defined __GNUC__ || 4 < __GNUC__ + (8 <= __GNUC_MINOR__)))
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)))
 #  define _Noreturn [[noreturn]]
 # elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
         || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))