[cfe-dev] Is this a redundant statement?

Nikola Smiljanic popizdeh at gmail.com
Tue Apr 14 05:36:56 PDT 2015


You're right, thanks. Remove in r234881.

On Wed, Apr 8, 2015 at 5:50 PM, Mingjie Xing <mingjie.xing at gmail.com> wrote:

> Hello,
>
> Look at the last call statement "Init.get();" in the following
> function, in file lib/Sema/SemaInit.cpp.  It seems useless.
>
> ExprResult
> Sema::PerformCopyInitialization(const InitializedEntity &Entity,
>                                 SourceLocation EqualLoc,
>                                 ExprResult Init,
>                                 bool TopLevelOfInitList,
>                                 bool AllowExplicit) {
>   if (Init.isInvalid())
>     return ExprError();
>
>   Expr *InitE = Init.get();
>   assert(InitE && "No initialization expression?");
>
>   if (EqualLoc.isInvalid())
>     EqualLoc = InitE->getLocStart();
>
>   InitializationKind Kind =
> InitializationKind::CreateCopy(InitE->getLocStart(),
>                                                            EqualLoc,
>                                                            AllowExplicit);
>   InitializationSequence Seq(*this, Entity, Kind, InitE,
> TopLevelOfInitList);
>   Init.get();
>
>   ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE);
>
>   return Result;
> }
>
> Mingjie
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150414/eac36957/attachment.html>


More information about the cfe-dev mailing list