]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
_Noreturn: Fix compilation in C++ mode on Solaris (regr. 2025-06-27).
authorBruno Haible <bruno@clisp.org>
Mon, 30 Jun 2025 07:55:06 +0000 (09:55 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 30 Jun 2025 07:55:06 +0000 (09:55 +0200)
* lib/_Noreturn.h (_Noreturn): Restore C++ mode handling.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.

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

index e6ab5a498172dec6d28bf2b909766ffbf927f880..2ab8971e51fc491be85b42645861f6cb2daa8391 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-06-30  Bruno Haible  <bruno@clisp.org>
+
+       _Noreturn: Fix compilation in C++ mode on Solaris (regr. 2025-06-27).
+       * lib/_Noreturn.h (_Noreturn): Restore C++ mode handling.
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
+
 2025-06-30  Bruno Haible  <bruno@clisp.org>
 
        kwset tests: Fix link error.
index 8e63387914cfe1fa272fae42cfd54b8661047713..d42f15eee62540990d8962e32cbea425ea434fa5 100644 (file)
@@ -27,7 +27,8 @@
    This rare bug can be worked around by compiling with 'clang -D_Noreturn=',
    though the workaround may generate many false-alarm warnings.  */
 #ifndef _Noreturn
-# if 201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)
+# if ((!defined __cplusplus || defined __clang__) \
+      && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)))
    /* _Noreturn works as-is.  */
 # elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
         || 0x5110 <= __SUNPRO_C)
index d525d8b1faab8b82e6271d38acd194a49c64e994..034dae69e68e9887fb87ed9947faa2f7bedd6f3a 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 112
+# serial 113
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -70,7 +70,8 @@ AC_DEFUN([gl_COMMON_BODY], [
    This rare bug can be worked around by compiling with 'clang -D_Noreturn=',
    though the workaround may generate many false-alarm warnings.  */
 #ifndef _Noreturn
-# if 201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)
+# if ((!defined __cplusplus || defined __clang__) \
+      && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)))
    /* _Noreturn works as-is.  */
 # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
    /* Prefer __attribute__ ((__noreturn__)) to plain _Noreturn even if the