From: Bruno Haible Date: Mon, 5 Aug 2024 14:27:13 +0000 (+0200) Subject: Fix compilation error in C++ mode with clang >= 16 (regr. 2024-07-29). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=14b5283963f5146479eb25f6bd8ab626fd6c8ff5;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index b233847db6..7f0942db4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-08-05 Bruno Haible + + 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 dfa-tests: Detect test-dfa-match-aux error. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index f716d7a353..b208dc1266 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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 + . */ /* 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