bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang++ 11 compilation issues


From: Paul Eggert
Subject: Re: clang++ 11 compilation issues
Date: Wed, 13 Jan 2021 17:55:31 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

On 1/13/21 5:21 PM, Bruno Haible wrote:
For example, say, someone use g++ version >= 5 with option -std=c++98. Then,
with your new code, __cpp_static_assert will be undefined,
_GL_HAVE__STATIC_ASSERT will be 1, and _GL_VERIFY(R, DIAGNOSTIC, ...) will
expand to
   _Static_assert (R, DIAGNOSTIC)
which most likely leads to a syntax error.

Thanks, I see your point. (I had to use -std=gnu++98 to observe the problem.)

How about the attached, more-conservative patch instead? It limits __cpp_static_assert to controlling the use of 'static_assert', and causes C++ code to not use _Static_assert at all.

Also note that the C++ test coverage of this module is currently zero (none).
This means that if you make this change and it is buggy, we have no way to
catch it, before some user will stumble across it.

The users in this case are developers, and the failure mode is merely a trivial failure to compile, so these problems should be relatively minor. And when things go wrong (as they likely will regardless of whether this patch is installed :-), having a simpler verify.h will ease users' jobs.

Attachment: 0001-verify-simplify-static_assert-configuration.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]