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.
This commit is contained in:
Jonathan Wakely
2023-11-10 21:06:15 +00:00
parent f7251b7886
commit 807f47497f

View File

@@ -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