#4982·windows-rs

`windows-clang` rejects identical function declarations across headers

Author: yassterCreated Sep 22, 2026Updated Sep 22, 2026

Passing two headers as separate Inputs to extract, then calling emit_with_options, fails when they declare the same C function. Both headers contain:

cpp
extern "C" int SharedFunction(int value);

Actual:

ambiguous function root `SharedFunction`

The two facts have identical linker names, calling conventions, parameter types, annotations, and return types. Only their source locations and translation units differ.

These declarations should produce one function. Changing the second return type to double should still be rejected; that negative control currently fails as expected.

This differs from #4186: the failure happens while reconciling header declarations, before RDL is emitted.

Reproduced on unmodified a38689a8, Windows x64, libclang 22.1.8, with -x c++ --target=x86_64-pc-windows-msvc -std=c++17, namespace Repro, and library example.dll. No SDK headers or reference metadata are needed.