]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation error in C++ mode with clang >= 16 (regr. 2024-07-29).
authorBruno Haible <bruno@clisp.org>
Mon, 5 Aug 2024 14:27:13 +0000 (16:27 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 5 Aug 2024 14:31:44 +0000 (16:31 +0200)
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_BRACKET_BEFORE_ATTRIBUTE with clang++ 16 or newer.

ChangeLog
m4/gnulib-common.m4

index b233847db670bdbb01f4ebee08e68cdb4b6c6891..7f0942db4dfd08e3ff26afcbd78ce1d21466f9d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-05  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation error in C++ mode with clang >= 16 (regr. 2024-07-29).
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Define
+       _GL_BRACKET_BEFORE_ATTRIBUTE with clang++ 16 or newer.
+
 2024-08-05  Bernhard Voelker  <mail@bernhard-voelker.de>
 
        dfa-tests: Detect test-dfa-match-aux error.
index f716d7a35346572b579a6de222802480f0c186a4..b208dc12662b06e2fe018af330ec9a7688c5ed32 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 99
+# serial 100
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -146,6 +146,8 @@ AC_DEFUN([gl_COMMON_BODY], [
       This gives a syntax error
         - in C mode with gcc, and
         - in C++ mode with clang++ version < 16.
+        - in C++ mode, inside extern "C" {}, still in newer clang++ versions
+          <https://github.com/llvm/llvm-project/issues/101990>.
  */
 /* Define if, in a function declaration, the attributes in bracket syntax
    [[...]] must come before the attributes in __attribute__((...)) syntax.
@@ -153,7 +155,7 @@ AC_DEFUN([gl_COMMON_BODY], [
    various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
    order.  */
 #ifdef __cplusplus
-# if defined __clang__ && __clang_major__ < 16
+# if defined __clang__
 #  define _GL_BRACKET_BEFORE_ATTRIBUTE 1
 # endif
 #else