On Mon, Aug 6, 2012 at 4:12 PM, Richard Smith <[email protected]> wrote:
> On Mon, Aug 6, 2012 at 2:09 PM, Richard Trieu <[email protected]> wrote: > >> Author: rtrieu >> Date: Mon Aug 6 16:09:23 2012 >> New Revision: 161345 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=161345&view=rev >> Log: >> For global record types, the self reference checker was called twice, >> resulting >> in duplicate -Wuninitialized warnings. Change so that only the check in >> TryConstructorInitialization() will be used and a single warning be >> emitted. >> >> Modified: >> cfe/trunk/lib/Sema/SemaDecl.cpp >> cfe/trunk/test/SemaCXX/uninitialized.cpp >> >> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=161345&r1=161344&r2=161345&view=diff >> >> ============================================================================== >> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) >> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Aug 6 16:09:23 2012 >> @@ -6310,7 +6310,10 @@ >> // Check for self-references within variable initializers. >> // Variables declared within a function/method body are handled >> // by a dataflow analysis. >> - if (!VDecl->hasLocalStorage() && !VDecl->isStaticLocal()) >> + // Record types initialized by initializer list are handled here. >> + // Initialization by constructors are handled in >> TryConstructorInitialization. >> + if (!VDecl->hasLocalStorage() && !VDecl->isStaticLocal() && >> > > (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? > Testing says local statics aren't checked. I'll go yank out the check and add some test cases for local statics.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
