Skip to content
Snippets Groups Projects
Commit f9a28abe authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses...

Make -Wsemicolon-before-method-body opt-in (and part of -Wextra).  Addresses <rdar://problem/7381735>.

llvm-svn: 86731
parent fc9469f3
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,7 @@ def : DiagGroup<"pointer-to-int-cast">; ...@@ -69,6 +69,7 @@ def : DiagGroup<"pointer-to-int-cast">;
def : DiagGroup<"redundant-decls">; def : DiagGroup<"redundant-decls">;
def ReturnType : DiagGroup<"return-type">; def ReturnType : DiagGroup<"return-type">;
def : DiagGroup<"sequence-point">; def : DiagGroup<"sequence-point">;
def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
def : DiagGroup<"shadow">; def : DiagGroup<"shadow">;
def : DiagGroup<"shorten-64-to-32">; def : DiagGroup<"shorten-64-to-32">;
def SignCompare : DiagGroup<"sign-compare">; def SignCompare : DiagGroup<"sign-compare">;
...@@ -133,8 +134,8 @@ def FormatY2K : DiagGroup<"format-y2k", [Format]>; ...@@ -133,8 +134,8 @@ def FormatY2K : DiagGroup<"format-y2k", [Format]>;
def Format2 : DiagGroup<"format=2", def Format2 : DiagGroup<"format=2",
[FormatNonLiteral, FormatSecurity, FormatY2K]>; [FormatNonLiteral, FormatSecurity, FormatY2K]>;
def Extra : DiagGroup<"extra", [ def Extra : DiagGroup<"extra", [
SemiBeforeMethodBody,
SignCompare, SignCompare,
UnusedParameter UnusedParameter
]>; ]>;
......
...@@ -201,9 +201,9 @@ def warn_expected_implementation : Warning< ...@@ -201,9 +201,9 @@ def warn_expected_implementation : Warning<
"@end must appear in an @implementation context">; "@end must appear in an @implementation context">;
def error_property_ivar_decl : Error< def error_property_ivar_decl : Error<
"property synthesize requires specification of an ivar">; "property synthesize requires specification of an ivar">;
def warn_semicolon_before_method_nody : Warning< def warn_semicolon_before_method_body : Warning<
"semicolon before method body is ignored">, "semicolon before method body is ignored">,
InGroup<DiagGroup<"semicolon-before-method-body">>; InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
def err_expected_field_designator : Error< def err_expected_field_designator : Error<
"expected a field designator, such as '.field = 4'">; "expected a field designator, such as '.field = 4'">;
......
...@@ -1410,7 +1410,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDefinition() { ...@@ -1410,7 +1410,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDefinition() {
// parse optional ';' // parse optional ';'
if (Tok.is(tok::semi)) { if (Tok.is(tok::semi)) {
if (ObjCImpDecl) if (ObjCImpDecl)
Diag(Tok, diag::warn_semicolon_before_method_nody); Diag(Tok, diag::warn_semicolon_before_method_body);
ConsumeToken(); ConsumeToken();
} }
......
// RUN: clang-cc %s -verify -fsyntax-only // RUN: clang-cc -Wsemicolon-before-method-body %s -verify -fsyntax-only
#define nil 0 /* id of Nil instance */ #define nil 0 /* id of Nil instance */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment