Adds couple of missing warning flags so warnings can be turned
off. // rdar://12501960
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166150 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td
index 6fc6cad..97713de 100644
--- a/include/clang/Basic/DiagnosticGroups.td
+++ b/include/clang/Basic/DiagnosticGroups.td
@@ -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">;
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 3c420b9..51bb9f5 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -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">;
diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c
index c027523..302abcc 100644
--- a/test/Misc/warning-flags.c
+++ b/test/Misc/warning-flags.c
@@ -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
diff --git a/test/SemaCXX/no-warn-composite-pointer-type.cpp b/test/SemaCXX/no-warn-composite-pointer-type.cpp
new file mode 100644
index 0000000..b52914a
--- /dev/null
+++ b/test/SemaCXX/no-warn-composite-pointer-type.cpp
@@ -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;
+}