[cfe-commits] r159600 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Misc/warning-flags.c
Matt Beaumont-Gay
matthewbg at google.com
Mon Jul 2 14:58:14 PDT 2012
Author: matthewbg
Date: Mon Jul 2 16:58:14 2012
New Revision: 159600
URL: http://llvm.org/viewvc/llvm-project?rev=159600&view=rev
Log:
Add a warning flag for "'extern' variable has an initializer".
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Misc/warning-flags.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=159600&r1=159599&r2=159600&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Jul 2 16:58:14 2012
@@ -3180,7 +3180,8 @@
"'__local' variable cannot have an initializer">;
def err_block_extern_cant_init : Error<
"'extern' variable cannot have an initializer">;
-def warn_extern_init : Warning<"'extern' variable has an initializer">;
+def warn_extern_init : Warning<"'extern' variable has an initializer">,
+ InGroup<DiagGroup<"extern-initializer">>;
def err_variable_object_no_init : Error<
"variable-sized object may not be initialized">;
def err_excess_initializers : Error<
Modified: cfe/trunk/test/Misc/warning-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warning-flags.c?rev=159600&r1=159599&r2=159600&view=diff
==============================================================================
--- cfe/trunk/test/Misc/warning-flags.c (original)
+++ cfe/trunk/test/Misc/warning-flags.c Mon Jul 2 16:58:14 2012
@@ -17,7 +17,7 @@
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (230):
+CHECK: Warnings without flags (229):
CHECK-NEXT: ext_anonymous_struct_union_qualified
CHECK-NEXT: ext_binary_literal
CHECK-NEXT: ext_cast_fn_obj
@@ -141,7 +141,6 @@
CHECK-NEXT: warn_excess_initializers
CHECK-NEXT: warn_excess_initializers_in_char_array_initializer
CHECK-NEXT: warn_expected_qualified_after_typename
-CHECK-NEXT: warn_extern_init
CHECK-NEXT: warn_extraneous_char_constant
CHECK-NEXT: warn_fe_cc_log_diagnostics_failure
CHECK-NEXT: warn_fe_cc_print_header_failure
More information about the cfe-commits
mailing list