Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-14 Thread Richard Smith via cfe-commits
On Fri, Aug 14, 2015 at 7:15 AM, Davide Italiano wrote: > davide added a comment. > > Oops, I uploaded the wrong diff. Anyway, I changed can't to cannot and > committed this as r245051. > While looking at DiagnosticSemaKind.td I noticed there are still 7 > diagnostics that use can't instead of ca

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-14 Thread Davide Italiano via cfe-commits
davide added a comment. Oops, I uploaded the wrong diff. Anyway, I changed can't to cannot and committed this as r245051. While looking at DiagnosticSemaKind.td I noticed there are still 7 diagnostics that use can't instead of cannot. Are you OK if I change those? (in a subsequent commit, of co

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-12 Thread Richard Smith via cfe-commits
rsmith added a comment. Looks good other than the diagnostic wording. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:513 @@ -512,1 +512,3 @@ "platform-specific data}0) must be of type %1">; +def err_main_global_variable : Error<"main can't be declared as global var

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-12 Thread Davide Italiano via cfe-commits
davide updated this revision to Diff 31932. davide added a comment. - Refactored check - Added test for -ffreestanding in C - Changed the diagnostic emitted Also, thanks for your time and guidance. http://reviews.llvm.org/D11658 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/Se

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-10 Thread Richard Smith via cfe-commits
rsmith added a comment. Maybe you could refactor the check to something like: if (Name.isIdentifier() && Name.getAsIdentifierInfo()->isStr("main") NewVD->getDeclContext()->getRedeclContext()->isTranslationUnit() && !getLangOpts().Freestanding && !NewVD->getDescribedVarTemplate()) {

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-10 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jul 30, 2015 at 07:01:22PM +, Davide Italiano wrote: > Index: test/CXX/basic/basic.start/basic.start.main/p3.cpp > === > --- test/CXX/basic/basic.start/basic.start.main/p3.cpp > +++ test/CXX/basic/basic.start/basic.start.ma

Re: [PATCH] D11658: [Sema] main can't be declared as global variable

2015-08-06 Thread Davide Italiano via cfe-commits
davide added a comment. Hi Richard, do you have any comments on the new patch? http://reviews.llvm.org/D11658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits