Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 323ae695da8c973e153d37b66e954a08898696ab
      
https://github.com/WebKit/WebKit/commit/323ae695da8c973e153d37b66e954a08898696ab
  Author: David Kilzer <[email protected]>
  Date:   2026-07-08 (Wed, 08 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/GenericTimeMixin.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:
  -----------
  [WTF] GenericTimeMixin-derived time classes fail to build with Swift C++ 
interoperability
<https://bugs.webkit.org/show_bug.cgi?id=318801>
<rdar://181623908>

Reviewed by Adrian Taylor.

A newer version of Apple's Swift C++ interoperability importer fails
to synthesize a `bool` conversion for a class that inherits
`explicit operator bool` from a dependent template base, so importing
a `GenericTimeMixin`-derived time class (`MonotonicTime`, `WallTime`,
and others) into a Swift module fails with "cannot convert ... to
'bool' without a conversion operator" (rdar://181622867).  The operator
cannot be hidden from the importer, because the synthesis is eager and
the same module compiles C++ callers such as `TimerBase::isActive()`
that need it.

Re-declare the operator with a `using` declaration in each derived
class.  The importer synthesizes the conversion correctly when the
operator is declared on the non-dependent derived class, while the base
keeps it for all C++ callers.

No new tests since this change is not directly testable.

* Source/WTF/wtf/ApproximateTime.h:
(WTF::ApproximateTime):
* Source/WTF/wtf/ContinuousApproximateTime.h:
(WTF::ContinuousApproximateTime):
* Source/WTF/wtf/ContinuousTime.h:
(WTF::ContinuousTime):
* Source/WTF/wtf/GenericTimeMixin.h:
(WTF::GenericTimeMixin::operator bool):
* Source/WTF/wtf/MonotonicTime.h:
(WTF::MonotonicTime):
* Source/WTF/wtf/ReducedResolutionSeconds.h:
(WTF::ReducedResolutionSeconds):
* Source/WTF/wtf/UnbarrieredMonotonicTime.h:
(WTF::UnbarrieredMonotonicTime):
* Source/WTF/wtf/WallTime.h:
(WTF::WallTime):

Canonical link: https://commits.webkit.org/316725@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to