https://bugs.llvm.org/show_bug.cgi?id=49708

Gonzalo BG <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Gonzalo BG <[email protected]> ---
https://eel.is/c++draft/expr.static.cast#13 states 

>If the original pointer value represents the address A of a byte in memory and 
>A does not satisfy the alignment requirement of T, then the resulting pointer 
>value is unspecified.

So the behavior of `(int*)char_ptr` is unspecified, since that's equivalent to
`static_cast<int*>(static_cast<void*>(char_ptr))` and char_ptr does not satisfy
the alignment requirement of `int`.

Closing as non-bug. Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to