зеркало из https://github.com/microsoft/clang-1.git
<rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
325de0ca0c
Коммит
e4743be898
|
@ -7167,9 +7167,14 @@ TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *E) {
|
|||
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'.
|
||||
|
|
Загрузка…
Ссылка в новой задаче