Open
Description
If a function is declared without dllexport
and called, but is later defined with dllexport
, clang generates an error. GCC does not suffer from this issue (the attributes are merged, as if all declarations had dllexport
).
void
foo(void);
void
bar(void)
{
foo(); /* the error goes away if this call is deleted */
}
__declspec(dllexport)
void
foo(void) /* test.c:3:28: error: redeclaration of 'foo' cannot add 'dllexport' attribute */
{
}
E:\lh_mouse\Desktop>clang --version
clang version 14.0.0
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/MSYS2/clang64/bin