[cfe-commits] r84762 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/attr-noreturn.c
Douglas Gregor
dgregor at apple.com
Wed Oct 21 08:46:01 PDT 2009
Author: dgregor
Date: Wed Oct 21 10:46:01 2009
New Revision: 84762
URL: http://llvm.org/viewvc/llvm-project?rev=84762&view=rev
Log:
Downgrade "function declared 'noreturn' should not return" from an
error (by default) to a warning, per C++0x [dcl.attr.noreturn]. Patch
from Sean Hunt!
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Sema/attr-noreturn.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=84762&r1=84761&r2=84762&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Oct 21 10:46:01 2009
@@ -2203,7 +2203,7 @@
def ext_return_has_void_expr : Extension<
"void %select{function|method}1 %0 should not return void expression">;
def warn_noreturn_function_has_return_expr : Warning<
- "function %0 declared 'noreturn' should not return">, DefaultError,
+ "function %0 declared 'noreturn' should not return">,
InGroup<DiagGroup<"invalid-noreturn">>;
def warn_falloff_noreturn_function : Warning<
"function declared 'noreturn' should not return">,
Modified: cfe/trunk/test/Sema/attr-noreturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-noreturn.c?rev=84762&r1=84761&r2=84762&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-noreturn.c (original)
+++ cfe/trunk/test/Sema/attr-noreturn.c Wed Oct 21 10:46:01 2009
@@ -15,14 +15,14 @@
void f3() __attribute__((noreturn));
void f3() {
- return; // expected-error {{function 'f3' declared 'noreturn' should not return}}
+ return; // expected-warning {{function 'f3' declared 'noreturn' should not return}}
}
-#pragma clang diagnostic warning "-Winvalid-noreturn"
+#pragma clang diagnostic error "-Winvalid-noreturn"
void f4() __attribute__((noreturn));
void f4() {
- return; // expected-warning {{function 'f4' declared 'noreturn' should not return}}
+ return; // expected-error {{function 'f4' declared 'noreturn' should not return}}
}
// PR4685
More information about the cfe-commits
mailing list