Skip to content
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

[expr.dynamic.cast] The phrase "runtime check" is not quite correct #6799

Open
frederick-vs-ja opened this issue Feb 7, 2024 · 1 comment

Comments

@frederick-vs-ja
Copy link
Contributor

dynamic_cast, which possibly performs the so-called "runtime check", is allowed in constant evaluation since C++20 via P1327R1. Perhaps we should choose another phrase to describe such checks.

@Eisenwave
Copy link
Contributor

Eisenwave commented Feb 28, 2024

I fully agree. C++ doesn't really have a concept of runtime or compile-time anyway, so this wording feels very out-of-place in general.

Perhaps something like

 If T is “pointer to cv void”, then the result is a pointer to
 the most derived object pointed to by v.
-Otherwise, a runtime check is applied to see if the object pointed or
-referred to by v can be converted to the type pointed or referred to by T.
+Otherwise, the effect of the expression dynamic_cast<T>(v)
+is determined as follows.
[...]
-Otherwise, the runtime check fails.
+Otherwise, the cast fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants