]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use reserved form of [[__likely__]] in <variant>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 5 Jul 2024 19:00:04 +0000 (20:00 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 7 Oct 2024 08:55:20 +0000 (09:55 +0100)
We should not use [[unlikely]] before C++20, so use [[__unlikely__]]
instead.

libstdc++-v3/ChangeLog:

* include/std/variant (_Variant_storage::_M_reset): Use
__unlikely__ form of attribute instead of unlikely.

(cherry picked from commit 9f1cd51766f251aafe0f1b898892f79855892729)

libstdc++-v3/include/std/variant

index 9abe7b9ed6d755fc1e6b43c8ae527d2244364140..75214c687dfd31ebb81707976a2462737101ddcf 100644 (file)
@@ -491,7 +491,7 @@ namespace __variant
       constexpr void
       _M_reset()
       {
-       if (!_M_valid()) [[unlikely]]
+       if (!_M_valid()) [[__unlikely__]]
          return;
 
        std::__do_visit<void>([](auto&& __this_mem) mutable