Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

analyze/invalid-cpp-cast

This happens when cpp/cast is malformed or when the requested cast is not allowed for the source type and target type.

Mitigations

Call cpp/cast with exactly a target type and a value. Choose a conversion that is valid for those types.

cpp/cast behaves like C++ static_cast. If you need a less restricted cast, use cpp/unsafe-cast.