summaryrefslogtreecommitdiff
path: root/lib/_Noreturn.h
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-03-22 08:25:53 +0100
committerAkim Demaille <akim.demaille@gmail.com>2019-03-24 07:52:53 +0100
commit0d8714b7ced8e0e524014c57eb884a170d62cf43 (patch)
tree8d6e0d05e5af72ae707b371042e2dfe863882f35 /lib/_Noreturn.h
parent453ff940449bbbde9ec00f0bbf82a359c5598fc7 (diff)
downloadgnulib-0d8714b7ced8e0e524014c57eb884a170d62cf43.tar.gz
_Noreturn: beware of C's _Noreturn in C++ pre C++11
* lib/_Noreturn.h, m4/gnulib-common.m4: Using C's _Noreturn in C++98 appears to be supported by Clang, but not by GCC nor ICC.
Diffstat (limited to 'lib/_Noreturn.h')
-rw-r--r--lib/_Noreturn.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h
index 1629cef39b..7594e4b0c0 100644
--- a/lib/_Noreturn.h
+++ b/lib/_Noreturn.h
@@ -3,8 +3,9 @@
&& ((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__))
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
/* _Noreturn works as-is. */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))