[cfe-commits] r166150 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/Misc/warning-flags.c test/SemaCXX/no-warn-composite-pointer-type.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Oct 17 16:19:22 PDT 2012


Author: fjahanian
Date: Wed Oct 17 18:19:22 2012
New Revision: 166150

URL: http://llvm.org/viewvc/llvm-project?rev=166150&view=rev
Log:
Adds couple of missing warning flags so warnings can be turned
off. // rdar://12501960

Added:
    cfe/trunk/test/SemaCXX/no-warn-composite-pointer-type.cpp
Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Misc/warning-flags.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=166150&r1=166149&r2=166150&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Wed Oct 17 18:19:22 2012
@@ -209,6 +209,7 @@
                                     [TautologicalOutOfRangeCompare]>;
 def HeaderHygiene : DiagGroup<"header-hygiene">;
 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
+def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-type">;
 
 // Preprocessor warnings.
 def : DiagGroup<"builtin-macro-redefined">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=166150&r1=166149&r2=166150&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Oct 17 18:19:22 2012
@@ -4090,7 +4090,8 @@
 def err_typecheck_comparison_of_pointer_integer : Error<
   "comparison between pointer and integer (%0 and %1)">;
 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
-  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
+  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
+  InGroup<CompareDistinctPointerType>;
 def ext_typecheck_cond_incompatible_operands : ExtWarn<
   "incompatible operand types (%0 and %1)">;
 def err_cond_voidptr_arc : Error <
@@ -4100,7 +4101,7 @@
   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
 def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
   "comparison of distinct pointer types (%0 and %1) uses non-standard "
-  "composite pointer type %2">;
+  "composite pointer type %2">, InGroup<CompareDistinctPointerType>;
 def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
 def err_stmtexpr_file_scope : Error<
   "statement expression not allowed at file scope">;

Modified: cfe/trunk/test/Misc/warning-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warning-flags.c?rev=166150&r1=166149&r2=166150&view=diff
==============================================================================
--- cfe/trunk/test/Misc/warning-flags.c (original)
+++ cfe/trunk/test/Misc/warning-flags.c Wed Oct 17 18:19:22 2012
@@ -18,7 +18,7 @@
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (156):
+CHECK: Warnings without flags (154):
 CHECK-NEXT:   ext_delete_void_ptr_operand
 CHECK-NEXT:   ext_enum_friend
 CHECK-NEXT:   ext_expected_semi_decl_list
@@ -30,8 +30,6 @@
 CHECK-NEXT:   ext_plain_complex
 CHECK-NEXT:   ext_pp_macro_redef
 CHECK-NEXT:   ext_template_arg_extra_parens
-CHECK-NEXT:   ext_typecheck_comparison_of_distinct_pointers
-CHECK-NEXT:   ext_typecheck_comparison_of_distinct_pointers_nonstandard
 CHECK-NEXT:   ext_typecheck_comparison_of_pointer_integer
 CHECK-NEXT:   ext_typecheck_cond_incompatible_operands
 CHECK-NEXT:   ext_typecheck_cond_incompatible_operands_nonstandard

Added: cfe/trunk/test/SemaCXX/no-warn-composite-pointer-type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/no-warn-composite-pointer-type.cpp?rev=166150&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/no-warn-composite-pointer-type.cpp (added)
+++ cfe/trunk/test/SemaCXX/no-warn-composite-pointer-type.cpp Wed Oct 17 18:19:22 2012
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -Wno-compare-distinct-pointer-type -verify %s
+// rdar://12501960
+
+void Foo(int **thing, const int **thingMax)
+{
+        if ((thing + 3) > thingMax)
+                return;
+}





More information about the cfe-commits mailing list