On 01/21/15 16:50, Richard Smith wrote:
On Wed, Jan 21, 2015 at 12:32 PM, Joerg Sonnenberger
<[email protected]> wrote:
On Wed, Jan 21, 2015 at 01:04:12PM -0500, Nathan Sidwell wrote:
It did seem a very picky, but unrejected, bug report And I'd
forgotten about the gcc extension you mention. Perhaps it should be
a pedantic error and warning otherwise?
That's perfectly fine with me.
Yep, an ExtWarn works for me too.
Like this?
tested on x86_64-linux
nathan
Index: src/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- src/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision 226857)
+++ src/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td (working copy)
@@ -4329,7 +4329,7 @@ def note_exits_block_captures_strong : N
def note_exits_block_captures_weak : Note<
"jump exits lifetime of block which weakly captures a variable">;
-def err_func_returning_qualified_void : Error<
+def err_func_returning_qualified_void : ExtWarn<
"function cannot return qualified void type %0">;
def err_func_returning_array_function : Error<
"function cannot return %select{array|function}0 type %1">;
Index: src/tools/clang/test/Misc/warning-flags.c
===================================================================
--- src/tools/clang/test/Misc/warning-flags.c (revision 226857)
+++ src/tools/clang/test/Misc/warning-flags.c (working copy)
@@ -18,7 +18,8 @@ This test serves two purposes:
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (96):
+CHECK: Warnings without flags (97):
+CHECK-NEXT: err_func_returning_qualified_void
CHECK-NEXT: ext_excess_initializers
CHECK-NEXT: ext_excess_initializers_in_char_array_initializer
CHECK-NEXT: ext_expected_semi_decl_list
Index: src/tools/clang/test/Sema/function.c
===================================================================
--- src/tools/clang/test/Sema/function.c (revision 226857)
+++ src/tools/clang/test/Sema/function.c (working copy)
@@ -116,6 +116,6 @@ void t22(int *ptr, int (*array)[3]) {
void const Bar (void); // ok on decl
// PR 20146
-void const Bar (void) // expected-error {{function cannot return qualified void type 'const void'}}
+void const Bar (void) // expected-warning {{function cannot return qualified void type 'const void'}}
{
}
# svn diff src/tools/clang/tools/extra
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits