From: Chandler Carruth Date: Mon, 5 Sep 2011 05:47:35 +0000 (+0000) Subject: Enable -Wdangling-fields by default in Clang. I've run this warning over X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38f1d680b41f8bb8deb72899c7a45aebaadd0e52;p=clang Enable -Wdangling-fields by default in Clang. I've run this warning over a very large chunk of code and found zero false positives. I've only found a few bugs, but that likely is because bugs of this nature actually do manifest. We've also identified several bugs that were caught by Valgrind, but would have been caught faster and more easily with this warning. If anyone has concerns, or this causes fallout on any build bots, lemme know. I'm happy to just put it under -Wmost. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139112 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 4a019bbf8f..f0c7a5cad4 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -4358,13 +4358,13 @@ def note_ref_var_local_bind : Note< // a constructor parameter. def warn_bind_ref_member_to_parameter : Warning< "binding reference member %0 to stack allocated parameter %1">, - InGroup>, DefaultIgnore; + InGroup>; def warn_init_ptr_member_to_parameter_addr : Warning< "initializing pointer member %0 with the stack address of parameter %1">, - InGroup>, DefaultIgnore; + InGroup>; def warn_bind_ref_member_to_temporary : Warning< "binding reference member %0 to a temporary value">, - InGroup>, DefaultIgnore; + InGroup>; def note_ref_or_ptr_member_declared_here : Note< "%select{reference|pointer}0 member declared here">;