Open clausecker opened 2 years ago
@llvm/issue-subscribers-clang-frontend
+1 to please fix this. Here is my example:
__attribute__((weak)) void __throw_length_error(const char*) { while(1); };
Not sure why std version doesn't win in this case
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/string:1805:9: error: call to 'throw_length_error' is ambiguous
std::throw_length_error("basic_string");
^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/stdexcept:254:6: note: candidate function
void throw_length_error(const char*msg)
^
/Users/alex/work/repos/dsp-hr-transform-block/cpp/./edge-impulse-sdk/dsp/numpy_types.h:589:32: note: candidate function
attribute((weak)) void __throw_length_error(const char*) { while(1); };
In a variant of bug #35478, we can fix the compiler crash by declaring the functions involved with prototypes. This works fine when no parameters are involved. However, once a parameter enters the game, we get a weird compiler error. This is all C code.
When compiling with clang 14.0.6, I get the following error message:
This is very unexpected. GCC processes this code just fine.