Skip to content

Commit d9249e6

Browse files
committed
clarify what C++ does
1 parent 2418999 commit d9249e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rfcs/0000-const-ub.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ While compiling untrusted code should only be done with care (including addition
6767
[prior-art]: #prior-art
6868

6969
C++ requires compilers to detect UB in `constexpr`.
70-
However, the fragment of C++ that is available to `constexpr` excludes pointer casts (TODO: and pointer arithmetic and unions?), which makes such checks not very complicated and avoids all the poorly specified parts of UB.
70+
However, the fragment of C++ that is available to `constexpr` excludes pointer casts, pointer arithmetic (beyond array bounds), and union-based type punning, which makes such checks not very complicated and avoids most of the poorly specified parts of UB.
7171

7272
If we found a way to run CTFE on unoptimized MIR, then detecting UB for programs that do not use unions, `transmute`, or raw pointers is not very hard.
7373
CTFE already has almost all the checks required for this, except for alignment checks which are disabled during CTFE.

0 commit comments

Comments
 (0)