[clang] [Clang] fix crash by avoiding invalidation of extern main declaration during strictness checks (PR #104594)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 09:56:26 PDT 2024


================
@@ -78,12 +80,12 @@ namespace ns {
 extern "C" struct A { int main(); }; // ok
 
 namespace c {
-  extern "C" void main(); // expected-warning {{'main' should not be 'extern "C"'}}
+  extern "C" int main(); // expected-warning {{'main' should not be 'extern "C"'}}
 }
 
 extern "C" {
   namespace Z {
-    void main(); // expected-warning {{'main' should not be 'extern "C"'}}
----------------
cor3ntin wrote:

Why did you change this test?

https://github.com/llvm/llvm-project/pull/104594


More information about the cfe-commits mailing list