forked from OSchip/llvm-project
parent
50574f5303
commit
1f911dce22
|
@ -47,6 +47,7 @@ namespace {
|
|||
OwningExprResult VisitUnresolvedDeclRefExpr(UnresolvedDeclRefExpr *E);
|
||||
OwningExprResult VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
|
||||
OwningExprResult VisitImplicitCastExpr(ImplicitCastExpr *E);
|
||||
OwningExprResult VisitCXXThisExpr(CXXThisExpr *E);
|
||||
|
||||
// Base case. I'm supposed to ignore this.
|
||||
Sema::OwningExprResult VisitStmt(Stmt *S) {
|
||||
|
@ -418,6 +419,17 @@ Sema::OwningExprResult TemplateExprInstantiator::VisitImplicitCastExpr(
|
|||
return SemaRef.Owned(ICE);
|
||||
}
|
||||
|
||||
Sema::OwningExprResult
|
||||
TemplateExprInstantiator::VisitCXXThisExpr(CXXThisExpr *E) {
|
||||
QualType ThisType =
|
||||
cast<CXXMethodDecl>(SemaRef.CurContext)->getThisType(SemaRef.Context);
|
||||
|
||||
CXXThisExpr *TE =
|
||||
new (SemaRef.Context) CXXThisExpr(E->getLocStart(), ThisType);
|
||||
|
||||
return SemaRef.Owned(TE);
|
||||
}
|
||||
|
||||
Sema::OwningExprResult
|
||||
Sema::InstantiateExpr(Expr *E, const TemplateArgumentList &TemplateArgs) {
|
||||
TemplateExprInstantiator Instantiator(*this, TemplateArgs);
|
||||
|
|
|
@ -75,3 +75,11 @@ struct ConvertibleToInt {
|
|||
|
||||
template struct X6<ConvertibleToInt, float, char>;
|
||||
template struct X6<bool, int, int*>; // expected-note{{instantiation}}
|
||||
|
||||
template <typename T> struct X7 {
|
||||
void f() {
|
||||
void *v = this;
|
||||
}
|
||||
};
|
||||
|
||||
template struct X7<int>;
|
||||
|
|
Loading…
Reference in New Issue