[Concepts] Fix ConceptSpecializationExpr profiling crash

ConceptSpecializationExprs (CSEs) were being created with nullptr
TemplateArgsAsWritten during TemplateTemplateParmDecl canonicalization, and
we were relying on them during profiling which caused sporadic crashes
in test/CXX/.../temp.arg.template/p3-2a.cpp introduced in D44352.

Change profiling of CSEs to instead rely on the actual converted template
arguments and concept named.
This commit is contained in:
Saar Raz 2020-01-16 13:35:20 +02:00
parent b08e8353a8
commit 8a34467460
1 changed files with 3 additions and 3 deletions

View File

@ -1335,9 +1335,9 @@ void StmtProfiler::VisitAtomicExpr(const AtomicExpr *S) {
void StmtProfiler::VisitConceptSpecializationExpr(
const ConceptSpecializationExpr *S) {
VisitExpr(S);
VisitDecl(S->getFoundDecl());
VisitTemplateArguments(S->getTemplateArgsAsWritten()->getTemplateArgs(),
S->getTemplateArgsAsWritten()->NumTemplateArgs);
VisitDecl(S->getNamedConcept());
for (const TemplateArgument &Arg : S->getTemplateArguments())
VisitTemplateArgument(Arg);
}
static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S,