[PATCH] libcpp: Use [[likely]] conditionally

Jakub Jelinek jakub@redhat.com
Tue Nov 23 20:43:20 GMT 2021

On Tue, Nov 23, 2021 at 09:34:04PM +0100, Christophe Lyon via Gcc-patches wrote:
> > > This patch breaks the build when the host compiler is gcc-4.8.5,
> > > because __has_cpp_attribute is not defined.
> > Sigh.  I'd like to move to a more recent prereq if we could.
> >
> I don't know why we have such an old dependency indeed.
> I am not requesting it, I just happen to have an old enough host
> compiler so that I can check/complain when we accidentally
> break the dependency :-)

4.8.5 is still widely used and is the first one that supports C++11
reasonably well that it can be used.
__has_cpp_attribute has been added I think only in C++20, before that it was
in SD6, but even that is post C++11 I believe.
So provided we want to support C++11 (and IMHO we should, we can't afford to
be like Rust that can't build with a few days old compiler), we need to be
prepared that __has_cpp_attribute won't be defined.


More information about the Gcc-patches mailing list