public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-8310] libstdc++: Do not use assume attribute for Clang [PR112467]
@ 2024-02-09  8:46 Torbjorn Svensson
  0 siblings, 0 replies; only message in thread
From: Torbjorn Svensson @ 2024-02-09  8:46 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:adef1e0ebeb5055ed4e8776fd3f73c9d84821eaa

commit r13-8310-gadef1e0ebeb5055ed4e8776fd3f73c9d84821eaa
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 10 21:06:15 2023 +0000

    libstdc++: Do not use assume attribute for Clang [PR112467]
    
    Clang has an 'assume' attribute, but it's a function attribute not a
    statement attribute. The recently-added use of the statement form causes
    an error with Clang.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/112467
            * include/bits/stl_bvector.h (_M_assume_normalized): Do not use
            statement form of assume attribute for Clang.
    
    (cherry picked from commit 807f47497f17ed50be91f0f879308cb6fa063966)

Diff:
---
 libstdc++-v3/include/bits/stl_bvector.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 2b91af2005f2..64f04c1f4f59 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -185,8 +185,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     void
     _M_assume_normalized() const
     {
+#if __has_attribute(__assume__) && !defined(__clang__)
       unsigned int __ofst = _M_offset;
       __attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit))));
+#endif
     }
 
     _GLIBCXX20_CONSTEXPR

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-09  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09  8:46 [gcc r13-8310] libstdc++: Do not use assume attribute for Clang [PR112467] Torbjorn Svensson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).