From: David Majnemer Date: Wed, 22 Oct 2014 23:03:58 +0000 (+0000) Subject: Basic: Add ext_delete_void_ptr_operand to -Wdelete-incomplete X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81627cd1f5a173f43b41209738cefe51d97db97f;p=clang Basic: Add ext_delete_void_ptr_operand to -Wdelete-incomplete This fixes PR21340. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220442 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 0095590093..9b63735b60 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -71,6 +71,7 @@ def GNUDesignator : DiagGroup<"gnu-designator">; def GNUStringLiteralOperatorTemplate : DiagGroup<"gnu-string-literal-operator-template">; +def DeleteIncomplete : DiagGroup<"delete-incomplete">; def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">; def AbstractFinalClass : DiagGroup<"abstract-final-class">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 54d7040ce2..e6ad4b54bd 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -5314,12 +5314,13 @@ def note_add_initializer : Note< "add an explicit initializer to initialize %0">; def err_delete_operand : Error<"cannot delete expression of type %0">; def ext_delete_void_ptr_operand : ExtWarn< - "cannot delete expression with pointer-to-'void' type %0">; + "cannot delete expression with pointer-to-'void' type %0">, + InGroup; def err_ambiguous_delete_operand : Error< "ambiguous conversion of delete expression of type %0 to a pointer">; def warn_delete_incomplete : Warning< "deleting pointer to incomplete type %0 may cause undefined behavior">, - InGroup>; + InGroup; def err_delete_incomplete_class_type : Error< "deleting incomplete class type %0; no conversions to pointer type">; def err_delete_explicit_conversion : Error< diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 066cf01ed8..2afa88f5df 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,8 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (99): -CHECK-NEXT: ext_delete_void_ptr_operand +CHECK: Warnings without flags (98): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list