[Bug libstdc++/115797] [15 Regression] 'extern "C" { #include <math.h> }' fails with 'error: template with C linkage' since r15-1857-gde19b516edbf91

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 5 17:13:52 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115797

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I'll make this work again, but it's stupid code.

If the file is being compiled as C++, then <math.h> etc. are C++ headers, so
it's either redundant or incorrect to mess with the language linkage of their
contents.

It can only help for broken <math.h> headers that are not compatible with C++,
but in that case the hacky workaround should be limited to systems where those
headers are actually broken. Not applied unconditionally.


More information about the Gcc-bugs mailing list