mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
TblGen diagnostic for mismatched template instantiation.
Providing a template argment to a non-templatized class was crashing tblgen. Add a diagnostic. For example, $ cat bug.td class A; def B : A<0> { } $ llvm-tblgen bug.td bug.td:3:11: error: template argument provided to non-template class def B : A<0> { ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d56730ab8
commit
b1320cb381
@ -1516,6 +1516,10 @@ std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec,
|
||||
unsigned int ArgN = 0;
|
||||
if (ArgsRec != 0 && EltTy == 0) {
|
||||
const std::vector<Init *> &TArgs = ArgsRec->getTemplateArgs();
|
||||
if (!TArgs.size()) {
|
||||
TokError("template argument provided to non-template class");
|
||||
return std::vector<Init*>();
|
||||
}
|
||||
const RecordVal *RV = ArgsRec->getValue(TArgs[ArgN]);
|
||||
if (!RV) {
|
||||
errs() << "Cannot find template arg " << ArgN << " (" << TArgs[ArgN]
|
||||
|
Loading…
Reference in New Issue
Block a user