Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fbd1ff7b1fa573f055c0d17af1133a7e8a30846d
      
https://github.com/WebKit/WebKit/commit/fbd1ff7b1fa573f055c0d17af1133a7e8a30846d
  Author: Richard Robinson <[email protected]>
  Date:   2026-07-04 (Sat, 04 Jul 2026)

  Changed paths:
    M Tools/clangd/clangd-config.yaml.tpl

  Log Message:
  -----------
  [CMake] clangd sometimes produces incorrect diagnostics for .mm, .m, and .h 
files
https://bugs.webkit.org/show_bug.cgi?id=318615
rdar://181408485

Reviewed by Pascoe.

clangd was reporting some incorrect diagnostics like "called object type 'const 
char[75]' is not
a function or function pointer", "expected ')'".

The root cause is a force-include ordering bug. WebKitPrefix.h ends by 
"poisoning" new/delete so
that accidental new/delete usage without config.h is caught. config.h is what 
#undefs that.
WebKitPrefix.h is force-included by the frontend (via -Xclang -include via the 
PCH prefix header),
but the clangd config force-included config.h at the driver level 
(--include=config.h). The driver
injects its includes before frontend includes, so config.h's #undefs ran before 
the poison macros
were even defined. Force-including config.h also marked it as already-seen, so 
the body's own

Fix by (a) removing "--include=config.h" from the .mm/.m customizations, since 
that was pointless
anyways since those files already include it, and (b) for headers, inject the 
include via the
frontend instead of the driver to fix the ordering issue.

* Tools/clangd/clangd-config.yaml.tpl:

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



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

Reply via email to