================ @@ -122,6 +119,26 @@ namespace ns2 { extern "C++" void main() {} // ok } +#elif TEST14 +extern "C" { + int main(); // expected-warning {{'main' should not be 'extern "C"'}} +} + +extern "C" int main(); // expected-warning {{'main' should not be 'extern "C"'}} + +#elif TEST15 +extern "C" __attribute__((visibility("default"))) __attribute__((weak)) ---------------- alexfh wrote:
nit: This can be simplified a bit: ``` extern "C" __attribute__((visibility("default"))) __attribute__((weak)) int main(); unsigned long g() { return reinterpret_cast<unsigned long>(&main); } ``` https://gcc.godbolt.org/z/j5crjfebq https://github.com/llvm/llvm-project/pull/104594 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits