forked from OSchip/llvm-project
Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses <rdar://problem/7381735>.
llvm-svn: 86731
This commit is contained in:
parent
fc9469f311
commit
f9a28abe8d
|
@ -69,6 +69,7 @@ def : DiagGroup<"pointer-to-int-cast">;
|
|||
def : DiagGroup<"redundant-decls">;
|
||||
def ReturnType : DiagGroup<"return-type">;
|
||||
def : DiagGroup<"sequence-point">;
|
||||
def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
|
||||
def : DiagGroup<"shadow">;
|
||||
def : DiagGroup<"shorten-64-to-32">;
|
||||
def SignCompare : DiagGroup<"sign-compare">;
|
||||
|
@ -133,8 +134,8 @@ def FormatY2K : DiagGroup<"format-y2k", [Format]>;
|
|||
def Format2 : DiagGroup<"format=2",
|
||||
[FormatNonLiteral, FormatSecurity, FormatY2K]>;
|
||||
|
||||
|
||||
def Extra : DiagGroup<"extra", [
|
||||
SemiBeforeMethodBody,
|
||||
SignCompare,
|
||||
UnusedParameter
|
||||
]>;
|
||||
|
|
|
@ -201,9 +201,9 @@ def warn_expected_implementation : Warning<
|
|||
"@end must appear in an @implementation context">;
|
||||
def error_property_ivar_decl : Error<
|
||||
"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">,
|
||||
InGroup<DiagGroup<"semicolon-before-method-body">>;
|
||||
InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
|
||||
|
||||
def err_expected_field_designator : Error<
|
||||
"expected a field designator, such as '.field = 4'">;
|
||||
|
|
|
@ -1410,7 +1410,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDefinition() {
|
|||
// parse optional ';'
|
||||
if (Tok.is(tok::semi)) {
|
||||
if (ObjCImpDecl)
|
||||
Diag(Tok, diag::warn_semicolon_before_method_nody);
|
||||
Diag(Tok, diag::warn_semicolon_before_method_body);
|
||||
ConsumeToken();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue