diff options
author | David Blaikie <dblaikie@gmail.com> | 2011-09-08 06:33:04 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2011-09-08 06:33:04 +0000 |
commit | 14068e83f30864ed278fa43c5954404b47e99e7d (patch) | |
tree | d29c7a12245ae481f55ddc0617444f5c03943faf /include/clang | |
parent | e97179c675b341927807c718be215c8d1aab8acb (diff) |
Adding FixIts to static/inline main declaration diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 7 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 933632392f..b6aa33f448 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -289,11 +289,10 @@ def note_strlcpycat_wrong_size : Note< /// main() // static/inline main() are not errors in C, just in C++. -def warn_unusual_main_decl : Warning<"'main' should not be declared " - "%select{static|inline|static or inline}0">, +def warn_static_main : Warning<"'main' should not be declared static">, InGroup<Main>; -def err_unusual_main_decl : Error<"'main' is not allowed to be declared " - "%select{static|inline|static or inline}0">; +def err_static_main : Error<"'main' is not allowed to be declared static">; +def err_inline_main : Error<"'main' is not allowed to be declared inline">; def err_main_template_decl : Error<"'main' cannot be a template">; def err_main_returns_nonint : Error<"'main' must return 'int'">; def err_main_surplus_args : Error<"too many parameters (%0) for 'main': " diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index cfc267c1cf..fce56f0621 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1020,7 +1020,7 @@ public: FunctionDecl *NewFD, LookupResult &Previous, bool IsExplicitSpecialization, bool &Redeclaration); - void CheckMain(FunctionDecl *FD); + void CheckMain(FunctionDecl *FD, const DeclSpec &D); Decl *ActOnParamDeclarator(Scope *S, Declarator &D); ParmVarDecl *BuildParmVarDeclForTypedef(DeclContext *DC, SourceLocation Loc, |