Hasty Briefsbeta

Bilingual

Neither GCC nor Clang are compliant with standard C++

19 hours ago
  • In C++, function types have an associated 'language linkage' such as C++, C, or other implementation-defined options.
  • The standard mandates that function types with different language linkages are distinct types, even if they are otherwise identical.
  • GCC and Clang do not store language linkage information with the type, allowing identical treatment of C and C++ function types.
  • This leads to issues like static assertions failing incorrectly and compilation errors in function overloading scenarios.
  • The problem is attributed to the standard, not the compilers, and changing behavior would cause ABI breaks, with little practical need as calling conventions are often identical on most platforms.