It looks like the leak is rooted at the allocation here:1a155ee7de/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp (L3857)The VarTemplateSpecializationDecl is allocated using placement new which uses the AST structure for ownership:1a155ee7de/clang/lib/AST/DeclBase.cpp (L99)The problem is the TemplateArgumentListInfo inside1a155ee7de/clang/include/clang/AST/DeclTemplate.h (L2721)This object contains a vector which does not use placement new:1a155ee7de/clang/include/clang/AST/TemplateBase.h (L564)Apparently ASTTemplateArgumentListInfo should be used instead1a155ee7de/clang/include/clang/AST/TemplateBase.h (L575)https://reviews.llvm.org/D125802#3551305 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D126944
21 KiB
21 KiB