Skip to content

Commit cfc5126

Browse files
committed
Add brief explanations
1 parent eeae197 commit cfc5126

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Sema/SemaTemplateDeductionGuide.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ struct ConvertConstructorToDeductionGuideTransform {
377377
if (NestedPattern)
378378
Args.addOuterRetainedLevels(NestedPattern->getTemplateDepth());
379379
auto [Depth, Index] = getDepthAndIndex(Param);
380+
// Depth can still be 0 if FTD belongs to an explicit class template
381+
// specialization with an empty template parameter list. In that case,
382+
// we don't want the NewDepth to overflow, and it should remain 0.
380383
assert(Depth ||
381384
cast<ClassTemplateSpecializationDecl>(FTD->getDeclContext())
382385
->isExplicitSpecialization());

0 commit comments

Comments
 (0)