On Mon, Sep 17, 2012 at 7:26 AM, Axel Naumann <[email protected]> wrote:
> Author: axel > Date: Mon Sep 17 09:26:53 2012 > New Revision: 164033 > > URL: http://llvm.org/viewvc/llvm-project?rev=164033&view=rev > Log: > Don't write uninitialized values even if nobody ever asks for it. > It's not clear to me what the purpose of this change was: the variable is initialized by every case in the following switch, except the one with an llvm_unreachable. With this change, we'll not get a warning if one of the switch cases misses the initialization of the variable. > Modified: > cfe/trunk/lib/Sema/SemaDeclCXX.cpp > > Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=164033&r1=164032&r2=164033&view=diff > > ============================================================================== > --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) > +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Sep 17 09:26:53 2012 > @@ -4086,7 +4086,7 @@ > > // Compute argument constness, constexpr, and triviality. > bool CanHaveConstParam = false; > - bool Trivial; > + bool Trivial = false; > switch (CSM) { > case CXXDefaultConstructor: > Trivial = RD->hasTrivialDefaultConstructor(); > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
