intermittent lit failure: clang/test/CXX/temp/temp.arg/temp.arg.template/p3-2a.cpp

The test fails about 1 in 10 or 20 runs when I execute it via llvm-lit repeatedly in a shell loop. It encounters a null pointer dereference in this code in clang/lib/AST/StmtProfile.cpp:

void StmtProfiler::VisitConceptSpecializationExpr(

const ConceptSpecializationExpr *S) {

VisitExpr(S);

VisitDecl(S->getFoundDecl());

VisitTemplateArguments(S->getTemplateArgsAsWritten()->getTemplateArgs(),

S->getTemplateArgsAsWritten()->NumTemplateArgs);

}

The S->getTemplateArgsAsWritten() call returns null.

I have not been able to determine why the behavior is intermittent. Is there someone more familiar with this code who has an idea?

-Troy

+Saar for all things concepts.

Has anyone tried to reproduce this yet?

Thanks,
Troy

Hey,
Didn’t reproduce yet but I know how to fix the issue. That accessor can return null and there should be a null check there.
I’ll push a fix as soon as I can.
Thanks!

The accessor can return null intermittently? Why?

-Troy

Hmm seems the code you posted is out of date, 8a3446746098ba29348bb8f85357dd0b466a6d6e (1.16.20) fixed this issue.