зеркало из https://github.com/microsoft/clang-1.git
Make sure to free the explicit template arguments provided for an
explicit instantiation. Also, tighten up reference-count checking to help catch these issues earlier. Fixes PR5069. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
d789d3d985
Коммит
b2f81cf7f8
|
@ -188,7 +188,10 @@ public:
|
|||
return this;
|
||||
}
|
||||
|
||||
StmtClass getStmtClass() const { return (StmtClass)sClass; }
|
||||
StmtClass getStmtClass() const {
|
||||
assert(RefCount >= 1 && "Referencing already-destroyed statement!");
|
||||
return (StmtClass)sClass;
|
||||
}
|
||||
const char *getStmtClassName() const;
|
||||
|
||||
/// SourceLocation tokens are not useful in isolation - they are low level
|
||||
|
|
|
@ -3414,6 +3414,7 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
|
|||
TemplateId->getTemplateArgLocations(),
|
||||
TemplateArgs);
|
||||
HasExplicitTemplateArgs = true;
|
||||
TemplateArgsPtr.release();
|
||||
}
|
||||
|
||||
// C++ [temp.explicit]p1:
|
||||
|
|
|
@ -69,3 +69,7 @@ template void print_type<int>(float*); // expected-error{{does not refer}}
|
|||
|
||||
void print_type(double*);
|
||||
template void print_type<double>(double*);
|
||||
|
||||
// PR5069
|
||||
template<int I> void foo0 (int (&)[I + 1]) { }
|
||||
template void foo0<2> (int (&)[3]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче