[cfe-commits] r70500 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/Sema/return-silent.c test/Sema/return.c
Steve Naroff
snaroff at apple.com
Thu Apr 30 10:53:16 PDT 2009
Author: snaroff
Date: Thu Apr 30 12:53:16 2009
New Revision: 70500
URL: http://llvm.org/viewvc/llvm-project?rev=70500&view=rev
Log:
Name the "return-type" DiagGroup and reference it in a few places.
Added:
cfe/trunk/test/Sema/return-silent.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Sema/return.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=70500&r1=70499&r2=70500&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Thu Apr 30 12:53:16 2009
@@ -63,7 +63,7 @@
def : DiagGroup<"pointer-arith">;
def : DiagGroup<"pointer-to-int-cast">;
def : DiagGroup<"redundant-decls">;
-def : DiagGroup<"return-type">;
+def ReturnType : DiagGroup<"return-type">;
def : DiagGroup<"sequence-point">;
def : DiagGroup<"shadow">;
def : DiagGroup<"shorten-64-to-32">;
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=70500&r1=70499&r2=70500&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Apr 30 12:53:16 2009
@@ -1603,11 +1603,14 @@
"first argument to 'va_arg' is of type %0 and not 'va_list'">;
def warn_return_missing_expr : Warning<
- "non-void %select{function|method}1 %0 should return a value">;
+ "non-void %select{function|method}1 %0 should return a value">,
+ InGroup<ReturnType>;
def ext_return_missing_expr : ExtWarn<
- "non-void %select{function|method}1 %0 should return a value">;
+ "non-void %select{function|method}1 %0 should return a value">,
+ InGroup<ReturnType>;
def ext_return_has_expr : ExtWarn<
- "void %select{function|method}1 %0 should not return a value">;
+ "void %select{function|method}1 %0 should not return a value">,
+ InGroup<ReturnType>;
def ext_return_has_void_expr : Extension<
"void %select{function|method}1 %0 should not return void expression">;
def err_noreturn_function_has_return_expr : Error<
Added: cfe/trunk/test/Sema/return-silent.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return-silent.c?rev=70500&view=auto
==============================================================================
--- cfe/trunk/test/Sema/return-silent.c (added)
+++ cfe/trunk/test/Sema/return-silent.c Thu Apr 30 12:53:16 2009
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -Wno-return-type -fsyntax-only -verify
+
+int t14() {
+ return;
+}
+
+void t15() {
+ return 1;
+}
Modified: cfe/trunk/test/Sema/return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=70500&r1=70499&r2=70500&view=diff
==============================================================================
--- cfe/trunk/test/Sema/return.c (original)
+++ cfe/trunk/test/Sema/return.c Thu Apr 30 12:53:16 2009
@@ -7,3 +7,6 @@
return; // expected-warning {{non-void function 't14' should return a value}}
}
+void t15() {
+ return 1; // expected-warning {{void function 't15' should not return a value}}
+}
More information about the cfe-commits
mailing list