Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 02595a72c0f838bcad5c8608033e680d7e8f8408
https://github.com/WebKit/WebKit/commit/02595a72c0f838bcad5c8608033e680d7e8f8408
Author: David Kilzer <[email protected]>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M Source/WTF/wtf/ApproximateTime.h
M Source/WTF/wtf/ContinuousApproximateTime.h
M Source/WTF/wtf/ContinuousTime.h
M Source/WTF/wtf/MonotonicTime.h
M Source/WTF/wtf/ReducedResolutionSeconds.h
M Source/WTF/wtf/UnbarrieredMonotonicTime.h
M Source/WTF/wtf/WallTime.h
Log Message:
-----------
Build fix: [WTF] GenericTimeMixin-derived time classes fail to build with
Swift C++ interoperability
<https://bugs.webkit.org/show_bug.cgi?id=318801>
<rdar://181623908>
Unreviewed build fix.
316725@main attempted this fix with a using-declaration, but that does
not work: a using-declaration still resolves to the `operator bool`
declared on the dependent template base `GenericTimeMixin`, which is
what Swift's C++ interoperability importer mishandles. Emitting a
Swift module that imports a `GenericTimeMixin`-derived time class
therefore still fails with "cannot convert ... to 'bool' without a
conversion operator".
Declare a genuine `operator bool` on each derived time class. The
importer synthesizes the conversion correctly when the operator's
declaring context is the non-dependent derived class; the base
operator remains for all C++ callers.
No new tests since this change is not directly testable.
* Source/WTF/wtf/ApproximateTime.h:
(WTF::ApproximateTime::operator bool):
* Source/WTF/wtf/ContinuousApproximateTime.h:
(WTF::ContinuousApproximateTime::operator bool):
* Source/WTF/wtf/ContinuousTime.h:
(WTF::ContinuousTime::operator bool):
* Source/WTF/wtf/MonotonicTime.h:
(WTF::MonotonicTime::operator bool):
* Source/WTF/wtf/ReducedResolutionSeconds.h:
(WTF::ReducedResolutionSeconds::operator bool):
* Source/WTF/wtf/UnbarrieredMonotonicTime.h:
(WTF::UnbarrieredMonotonicTime::operator bool):
* Source/WTF/wtf/WallTime.h:
(WTF::WallTime::operator bool):
Canonical link: https://commits.webkit.org/316804@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications