[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

Alejandro Álvarez Ayllón via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 5 07:07:48 PDT 2024


================
@@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
                   getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc));
           }
           QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args);
-          if (T.isNull())
+          if (T.isNull() || T->containsErrors())
----------------
alejandro-alvarez-sonarsource wrote:

There is no reason besides that it is where I saw the crash. I have moved into `CheckTemplateIdType`. 

https://github.com/llvm/llvm-project/pull/96509


More information about the cfe-commits mailing list