TemplateArgumentList::TemplateArgumentList(ASTContext &Context,
const TemplateArgument *Args,
- unsigned NumArgs) {
+ unsigned NumArgs)
+ : NumFlatArguments(0), NumStructuredArguments(0) {
init(Context, Args, NumArgs);
}
return TemplateArgument(GetType(Record[Idx++]));
case TemplateArgument::Declaration:
return TemplateArgument(GetDecl(Record[Idx++]));
- case TemplateArgument::Integral:
- return TemplateArgument(ReadAPSInt(Record, Idx), GetType(Record[Idx++]));
+ case TemplateArgument::Integral: {
+ llvm::APSInt Value = ReadAPSInt(Record, Idx);
+ QualType T = GetType(Record[Idx++]);
+ return TemplateArgument(Value, T);
+ }
case TemplateArgument::Template:
return TemplateArgument(ReadTemplateName(Record, Idx));
case TemplateArgument::Expression:
FD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
switch ((FunctionDecl::TemplatedKind)Record[Idx++]) {
+ default: assert(false && "Unhandled TemplatedKind!");
+ break;
case FunctionDecl::TK_NonTemplate:
break;
case FunctionDecl::TK_FunctionTemplate:
NumTemplateArgLocs,
NumTemplateArgLocs ? TemplArgLocs.data() : 0,
LAngleLoc, RAngleLoc);
+ break;
}
case FunctionDecl::TK_DependentFunctionTemplateSpecialization: {
// Templates.
FD->setDependentTemplateSpecialization(*Reader.getContext(),
TemplDecls, TemplArgs);
+ break;
}
}
Record.push_back(D->getTemplatedKind());
switch (D->getTemplatedKind()) {
+ default: assert(false && "Unhandled TemplatedKind!");
+ break;
case FunctionDecl::TK_NonTemplate:
break;
case FunctionDecl::TK_FunctionTemplate:
template <typename T, int y>
T templ_f(T x) {
+ int z = templ_f<int, 5>(3);
return x+y;
}