rnk added inline comments.

================
Comment at: lib/Sema/SemaType.cpp:3269-3273
+  bool IsMain = false;
+  if (D.getIdentifier() && D.getIdentifier()->isStr("main") &&
+      S.CurContext->getRedeclContext()->isTranslationUnit() &&
+      !S.getLangOpts().Freestanding)
+    IsMain = true;
----------------
I highly doubt this is correct. I have a feeling there are all kinds of ways 
you can get this to fire on things that aren't a function declaration. It's 
also inefficient to check the identifier string every time we make a function 
type. Please find somewhere else to add this. I'd suggest adjusting the 
function type in CheckMain, or some time before then, whereever we make main 
implicitly extern "C".


https://reviews.llvm.org/D39210



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to