summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-10 22:16:29 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-10 22:16:29 +0000
commitf9a28abe8d1e575507d6804b19f2f2df54392607 (patch)
tree70fbfb1d5d4a3dca4aaebe226062cd4fe5f06d66
parentfc9469f3115bd9ba56facdaa09ce57baf438f873 (diff)
downloadbcm5719-llvm-f9a28abe8d1e575507d6804b19f2f2df54392607.tar.gz
bcm5719-llvm-f9a28abe8d1e575507d6804b19f2f2df54392607.zip
Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses <rdar://problem/7381735>.
llvm-svn: 86731
-rw-r--r--clang/include/clang/Basic/DiagnosticGroups.td3
-rw-r--r--clang/include/clang/Basic/DiagnosticParseKinds.td4
-rw-r--r--clang/lib/Parse/ParseObjc.cpp2
-rw-r--r--clang/test/SemaObjC/objc-string-constant.m2
4 files changed, 6 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 1280062d797..ae3f0ef7ec2 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -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
]>;
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
index 2d5a502bfea..036d887865d 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -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'">;
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index d06d8b6e9c7..478bdcbff75 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/lib/Parse/ParseObjc.cpp
@@ -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();
}
diff --git a/clang/test/SemaObjC/objc-string-constant.m b/clang/test/SemaObjC/objc-string-constant.m
index d27a46a9663..c6461dd1c25 100644
--- a/clang/test/SemaObjC/objc-string-constant.m
+++ b/clang/test/SemaObjC/objc-string-constant.m
@@ -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 */
OpenPOWER on IntegriCloud