Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b769e2ee79c861136dcae71c693a626ceece9179
https://github.com/WebKit/WebKit/commit/b769e2ee79c861136dcae71c693a626ceece9179
Author: David Kilzer <[email protected]>
Date: 2026-01-26 (Mon, 26 Jan 2026)
Changed paths:
M Source/JavaScriptCore/API/JSBase.h
Log Message:
-----------
JSC_CF_ENUM macro triggers -Welaborated-enum-base warnings with upstream clang
<https://bugs.webkit.org/show_bug.cgi?id=306197>
<rdar://168848718>
Reviewed by Darin Adler.
The JSC_CF_ENUM macro triggers -Welaborated-enum-base warnings when
compiling with upstream clang compilers. The warning fires because
CF_ENUM expands to a forward declaration of an enum with fixed
underlying type embedded in a typedef context, which violates C++11
[dcl.type.elab] requirements.
The fix modifies JSC_CF_ENUM to use different macro expansions for C++
vs. Objective-C compilation:
- C++: Use plain enum definition without forward declaration
- Objective-C: Keep CF_ENUM for Swift interoperability
- Swift imports headers in Objective-C mode, so the paths remain separate
This eliminates all -Welaborated-enum-base errors while maintaining full
backward compatibility and Swift interoperability.
No tests since no change in behavior.
* Source/JavaScriptCore/API/JSBase.h:
- Modified JSC_CF_ENUM macro to avoid forward declaration pattern in C++
compilation.
Canonical link: https://commits.webkit.org/306242@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications