aboutsummaryrefslogtreecommitdiffhomepage
path: root/print.html
diff options
context:
space:
mode:
Diffstat (limited to 'print.html')
-rw-r--r--print.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/print.html b/print.html
index 331b940..f09b78b 100644
--- a/print.html
+++ b/print.html
@@ -3324,7 +3324,11 @@ struct option {
constexpr T& value() {
assert(m_has_val);
- return *reinterpret_cast<T*>(m_val);
+ // Placement new starts a new lifetime, launder pointer returned to the
+ // aligned storage.
+ //
+ // [1] https://en.cppreference.com/w/cpp/utility/launder
+ return *__builtin_launder(reinterpret_cast<T*>(m_val));
}
private: