[cfe-commits] r88679 - in /cfe/trunk/lib/Sema: SemaDecl.cpp SemaDeclCXX.cpp
Douglas Gregor
dgregor at apple.com
Fri Nov 13 11:26:19 PST 2009
On Nov 13, 2009, at 11:21 AM, Anders Carlsson wrote:
> Author: andersca
> Date: Fri Nov 13 13:21:49 2009
> New Revision: 88679
>
> URL: http://llvm.org/viewvc/llvm-project?rev=88679&view=rev
> Log:
> Fix bug Doug noticed.
>
> Modified:
> cfe/trunk/lib/Sema/SemaDecl.cpp
> cfe/trunk/lib/Sema/SemaDeclCXX.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=88679&r1=88678&r2=88679&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Nov 13 13:21:49 2009
> @@ -4020,6 +4020,8 @@
>
> if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>
> (dcl))
> computeBaseOrMembersToDestroy(Destructor);
> +
> + assert(ExprTemporaries.empty() && "Leftover temporaries in
> function");
> return D;
> }
>
>
> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=88679&r1=88678&r2=88679&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Nov 13 13:21:49 2009
> @@ -1028,6 +1028,10 @@
> Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args,
> unsigned NumArgs, SourceLocation IdLoc,
> SourceLocation RParenLoc) {
> + // FIXME: CXXBaseOrMemberInitializer should only contain a single
> + // subexpression so we can wrap it in a CXXExprWithTemporaries if
> necessary.
> + ExprTemporaries.clear();
> +
Soo.... this works because CodeGen also has a hack, where it just
"knows" to destroy temporaries after each CXXBaseOrMemberInitializer?
- Doug
More information about the cfe-commits
mailing list