[clang] [clang] Fix crash on invalid `std::initializer_list<T>` template-id (PR #132284)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 31 16:22:23 PDT 2025


================
@@ -12182,10 +12182,14 @@ QualType Sema::BuildStdInitializerList(QualType Element, SourceLocation Loc) {
   Args.addArgument(TemplateArgumentLoc(TemplateArgument(Element),
                                        Context.getTrivialTypeSourceInfo(Element,
                                                                         Loc)));
+
+  QualType T = CheckTemplateIdType(TemplateName(StdInitializerList), Loc, Args);
----------------
offsetof wrote:

I opened a separate PR for this change: #133822

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


More information about the cfe-commits mailing list