r176731 - <rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
David Blaikie
dblaikie at gmail.com
Fri Mar 8 14:58:05 PST 2013
On Fri, Mar 8, 2013 at 2:43 PM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Fri Mar 8 16:43:48 2013
> New Revision: 176731
>
> URL: http://llvm.org/viewvc/llvm-project?rev=176731&view=rev
> Log:
> <rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
Test case?
>
> Modified:
> cfe/trunk/lib/Sema/TreeTransform.h
>
> Modified: cfe/trunk/lib/Sema/TreeTransform.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=176731&r1=176730&r2=176731&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/TreeTransform.h (original)
> +++ cfe/trunk/lib/Sema/TreeTransform.h Fri Mar 8 16:43:48 2013
> @@ -7167,9 +7167,14 @@ TreeTransform<Derived>::TransformCXXThis
> QualType T;
> if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DC))
> T = MD->getThisType(getSema().Context);
> - else
> + else if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(DC)) {
> T = getSema().Context.getPointerType(
> - getSema().Context.getRecordType(cast<CXXRecordDecl>(DC)));
> + getSema().Context.getRecordType(Record));
> + } else {
> + assert(SemaRef.Context.getDiagnostics().hasErrorOccurred() &&
> + "this in the wrong scope?");
> + return ExprError();
> + }
>
> if (!getDerived().AlwaysRebuild() && T == E->getType()) {
> // Make sure that we capture 'this'.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list