[Sema] main can't be declared as global variable, in C++.So, we now reject that. We also warn for any external-linkage globalvariable named main in C, because it results in undefined behavior.PR
[Sema] main can't be declared as global variable, in C++.So, we now reject that. We also warn for any external-linkage globalvariable named main in C, because it results in undefined behavior.PR: 24309Differential Revision: http://reviews.llvm.org/D11658Reviewed by: rsmithllvm-svn: 245051
show more ...
Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"We've decided to make the core rewriter class and PP rewriters mandatory.They're only a few hundr
Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"We've decided to make the core rewriter class and PP rewriters mandatory.They're only a few hundred lines of code in total and not worth supporting as adistinct build configuration, especially since doing so disables key compilerfeatures.This reverts commit r213150.Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."This reverts commit r213148.Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"This reverts commit r213146.llvm-svn: 213159
clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.llvm-svn: 213148
Don't accept qualified 'int' main return types in C++ or standard C modeC++ [basic.start.main]p1: "It shall have a return type of type int"ISO C is also clear about this, so only accept 'int' wit
Don't accept qualified 'int' main return types in C++ or standard C modeC++ [basic.start.main]p1: "It shall have a return type of type int"ISO C is also clear about this, so only accept 'int' with qualifiers in GNUModeC.llvm-svn: 212171
Sema: Do not merge new decls with invalid, old declsSema::MergeFunctionDecl attempts merging two decls even if the old declis invalid. This can lead to interesting circumstances where wesuccessf
Sema: Do not merge new decls with invalid, old declsSema::MergeFunctionDecl attempts merging two decls even if the old declis invalid. This can lead to interesting circumstances where wesuccessfully merge the decls but the result makes no sense.Take the following for example:template <typename T>int main(void);int main(void);Sema will not consider these to be overloads of the same name becausemain can't be overloaded, which means that this must be a redeclaration.In this case the templated decl is compatible with the non-templateddecl allowing the Sema::CheckFunctionDeclaration machinery to move onand do bizarre things like setting the previous decl of a non-templateddecl to a templated decl!The way I see it, we should just bail from MergeFunctionDecl if the olddecl is invalid.This fixes PR16531.llvm-svn: 185779
Sema: Fix a crash when main is redeclared as a function-template.This boils down to us sending invalid function decls toCheckFunctionDeclaration becauswe we did not consider that CheckMaincould c
Sema: Fix a crash when main is redeclared as a function-template.This boils down to us sending invalid function decls toCheckFunctionDeclaration becauswe we did not consider that CheckMaincould cause the decl to be invalid. Instead, interogate the new decl'smain-validity and *then* send it over to get CheckFunctionDeclaration'dif it was still valid after calling CheckMain.llvm-svn: 185745
PR15100: look through type sugar when determining whether we have one of theforms of 'main' which we accept as an extension.llvm-svn: 173758
Fold tests for C++ 'main' into a single file.llvm-svn: 173756
Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.llvm-svn: 1
Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.llvm-svn: 166280
Disallow constexpr main.llvm-svn: 149770
Modify how the -verify flag works. Currently, the verification string anddiagnostic message are compared. If either is a substring of the other, thenno error is given. This gives rise to an unex
Modify how the -verify flag works. Currently, the verification string anddiagnostic message are compared. If either is a substring of the other, thenno error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}}will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parametersIt will also match these other error messages: candidate function function has different number of parameters number of parametersThis patch will change so that the verification string must be a substring ofthe diagnostic message before accepting. Also, all the failing tests from thischange have been corrected. Some stats from this cleanup:87 - removed extra spaces around verification strings70 - wording updates to diagnostics40 - extra leading or trailing characters (typos, unmatched parens or quotes)35 - diagnostic level was included (error:, warning:, or note:)18 - flag name put in the warning (-Wprotocol)llvm-svn: 146619
Always treat 'main' as an extern "C" function, so that we detectredeclarations of main appropriately rather than allowing it to beoverloaded. Also, disallowing declaring main as a template.Fixes
Always treat 'main' as an extern "C" function, so that we detectredeclarations of main appropriately rather than allowing it to beoverloaded. Also, disallowing declaring main as a template.Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.llvm-svn: 117029
Tweak the text of several main() diagnostics and punch a hole specifically forDarwin's sekrit fourth argument. This should probably be factored tolet targets make target-specific decisions about w
Tweak the text of several main() diagnostics and punch a hole specifically forDarwin's sekrit fourth argument. This should probably be factored tolet targets make target-specific decisions about what main() should look like.Fixes rdar://problem/7414990or if different platforms have radically different ideas of what they want inllvm-svn: 92128
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'. - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead o
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'. - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target).llvm-svn: 91446
Semantic checking for main().Fix some invalid main() methods in the test suite that were nicelyexposed by the new checks.llvm-svn: 77047