~/lightning

Lightning Talk: The UB Detector: constexpr

Lightningat CppCon 2024 · on Sunday, 2024-09-15· [security]
slides:none on file

Claim that a constexpr evaluation forbids undefined behaviour is false: C++20 code using std::views::filter, mutating elements so they no longer satisfy the predicate, triggers UB at compile time and yields a surprising odd value where evens were expected. more than zero undefined behaviours. Compiler Explorer: clang and gcc agree and a compile-time static_assert fails with odd value 5. A second example shows a [[noreturn]] function returning a value is UB yet compilers sometimes accept it.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.