[clang] [C99] Claim conformance for _Complex support (PR #88161)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 08:39:28 PDT 2024


philnik777 wrote:

> > Note that
> > ```c++
> > auto div(_Complex float lhs, _Complex float rhs) {
> >   return lhs / rhs;
> > }
> > 
> > int main() {
> >   return __real div(1.f, 2.f);
> > }
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > will fail to link on windows due to `__divsc3` not being available. Similar programs probably also fail due to other compiler-rt functions not being available.
> 
> I _think_ Clang still gets to claim conformance here because we handle the language side of things correctly and the user is responsible for linking to a runtime library with appropriate support for the platform. However, this sure does straddle the line in some ways, so I could see this being a reason to claim "partial" conformance.

IIRC the problem is that you can't get compiler-rt on windows. If it was just a matter of compiling compiler-rt with clang I'd be 100% with you. Partial conformance with a note that some operations require compiler-rt functions that aren't available on windows seems like a good compromise to me.

https://github.com/llvm/llvm-project/pull/88161


More information about the cfe-commits mailing list