-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
__builtin_dynamic_object_size
mode 1 falls back to mode 0 when array index is not a constant expression
#66975
Comments
@llvm/issue-subscribers-clang-frontend
https://godbolt.org/z/MaEG8eEMd
For a struct like this:
The first @nickdesaulniers @isanbard |
The |
#78526 is the PR. It's getting pushback. |
[Moving the conversation from https://github.com//issues/72032 to the correct PR]
|
BTW: here's a WIP that implements the idea I had. I can convert it to what you are suggesting easily. But I'd like to confirm what the expected result is. https://github.com/bwendling/llvm-project/tree/__bdos-subobject |
https://godbolt.org/z/MaEG8eEMd
For a struct like this:
__bdos(x, 1)
should matchsizeof(x)
for the multidimensional array. When the array index is a constant expression, this works correctly. If it's not, it breaks:The first
bdos
is correct, the second is not.@nickdesaulniers @isanbard
The text was updated successfully, but these errors were encountered: