[cfe-commits] r164033 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Richard Smith
richard at metafoo.co.uk
Mon Sep 17 13:22:09 PDT 2012
On Mon, Sep 17, 2012 at 7:26 AM, Axel Naumann <Axel.Naumann at cern.ch> 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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120917/33c97545/attachment.html>
More information about the cfe-commits
mailing list