forked from OSchip/llvm-project
Fix a crash when "instantiating" VarDecls that are neither type nor value dependent.
llvm-svn: 89774
This commit is contained in:
parent
965f450d42
commit
b7408b95ed
|
@ -205,6 +205,7 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
|
|||
// we don't want to redo all the checking, especially since the
|
||||
// initializer might have been wrapped by a CXXConstructExpr since we did
|
||||
// it the first time.
|
||||
Var->setType(D->getType());
|
||||
Var->setInit(SemaRef.Context, Init.takeAs<Expr>());
|
||||
}
|
||||
else if (ParenListExpr *PLE = dyn_cast<ParenListExpr>((Expr *)Init.get())) {
|
||||
|
|
|
@ -18,3 +18,14 @@ template<typename T> B::B(T) {}
|
|||
// CHECK: define void @_ZN1BC1IiEET_(%struct.B* %this, i32)
|
||||
// CHECK: define void @_ZN1BC2IiEET_(%struct.B* %this, i32)
|
||||
template B::B(int);
|
||||
|
||||
template<typename T>
|
||||
struct C {
|
||||
void f() {
|
||||
int a[] = { 1, 2, 3 };
|
||||
}
|
||||
};
|
||||
|
||||
void f(C<int>& c) {
|
||||
c.f();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue