-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang does not implement __assume__
attribute, fails libstdc++ build
#71858
Comments
Meanwhile filed https://gcc.gnu.org/PR112467 on |
Note GCC's assume attribute is the same as C++23 assume standard attribute. |
@llvm/issue-subscribers-clang-frontend Author: Sergei Trofimovich (trofi)
`gcc` implements `__assume__` attribute as: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html, quoting the example:
int
foo (int x, int y)
{
__attribute__((assume(x == 42)));
__attribute__((assume(++y == 43)));
return x + y;
}
Recently void
_M_assume_normalized() const
{
unsigned int __ofst = _M_offset;
__attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit))));
} and Is there a change |
@AaronBallman is particularly opinionated about attribute |
We had a Discourse thread on this, and my thoughts at the time were: https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609/23 -- my thinking really hasn't changed all that much since then. I think we need LLVM changes before we can effectively implement the attribute and so we should report |
gcc
implements__assume__
attribute as: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html, quoting the example:clang-16
fails to build it as:Recently
gcc
started using it inlibstdc++
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e39b3e02c27bd7 asand
clang++
now fails to parse<vector>
fromlibstdc++
.Is there a change
clang
would support this style of__assume__
attribute or at least skipped it in stead of producing build failure?The text was updated successfully, but these errors were encountered: