[PATCH] D126937: Fix memleak in VarTemplateSpecializationDecl

Mital Ashok via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 19:28:04 PDT 2022


MitalAshok created this revision.
Herald added a project: All.
MitalAshok added reviewers: akyrtzi, aaron.ballman, erichkeane, browneee.
MitalAshok published this revision for review.
MitalAshok added a project: LLVM.
MitalAshok added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

VarTemplateSpecializationDecl held a TemplateArgumentListInfo which holds a SmallVector<TemplateArgumentLoc, 8>, so in this test case https://github.com/llvm/llvm-project/blob/ee1cf1f64519c815025d962bdf9c9bb3d09d7699/clang/test/SemaCXX/has_unique_object_reps_bitint.cpp#L27 where there was a variable template with more than 8 template arguments, it leaked


Replace TemplateArgumentListInfo with ASTTemplateArgumentListInfo
and convert between them in some places


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126937

Files:
  clang/include/clang/AST/DeclTemplate.h
  clang/include/clang/Sema/Template.h
  clang/lib/AST/DeclTemplate.cpp
  clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126937.433937.patch
Type: text/x-patch
Size: 4203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220603/63e3d30c/attachment.bin>


More information about the cfe-commits mailing list