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

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 +++

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()) { if