aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-11-10 21:06:15 +0000
committerJonathan Wakely <jwakely@redhat.com>2023-11-11 00:41:09 +0000
commit807f47497f17ed50be91f0f879308cb6fa063966 (patch)
treea24acb0e536f9a57c498ea0234fb01dbbfbd023a
parentf7251b7886c47cbd5c9ffb217eb9849f023f76da (diff)
downloadgcc-807f47497f17ed50be91f0f879308cb6fa063966.zip
gcc-807f47497f17ed50be91f0f879308cb6fa063966.tar.gz
gcc-807f47497f17ed50be91f0f879308cb6fa063966.tar.bz2
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.
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 2b91af2..64f04c1 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