<div class="gmail_quote">On Mon, Aug 6, 2012 at 2:09 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rtrieu<br>
Date: Mon Aug 6 16:09:23 2012<br>
New Revision: 161345<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=161345&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=161345&view=rev</a><br>
Log:<br>
For global record types, the self reference checker was called twice, resulting<br>
in duplicate -Wuninitialized warnings. Change so that only the check in<br>
TryConstructorInitialization() will be used and a single warning be emitted.<br>
<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaDecl.cpp<br>
cfe/trunk/test/SemaCXX/uninitialized.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=161345&r1=161344&r2=161345&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=161345&r1=161344&r2=161345&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Aug 6 16:09:23 2012<br>
@@ -6310,7 +6310,10 @@<br>
// Check for self-references within variable initializers.<br>
// Variables declared within a function/method body are handled<br>
// by a dataflow analysis.<br>
- if (!VDecl->hasLocalStorage() && !VDecl->isStaticLocal())<br>
+ // Record types initialized by initializer list are handled here.<br>
+ // Initialization by constructors are handled in TryConstructorInitialization.<br>
+ if (!VDecl->hasLocalStorage() && !VDecl->isStaticLocal() &&<br></blockquote><div><br></div><div>(Not changed by your patch, but...) This isStaticLocal() check looks suspicious. The CFG-based uninitialized values warning doesn't do anything for static locals, so presumably we don't check them anywhere?</div>
</div>