Skip to content

Commit fec4716

Browse files
authored
[clang] Use getDefaultArgRange instead of getDefaultArg to retrieve the (#79296)
source location in` AliasTemplateDeductionGuideTransform`. I don't have a reproducible testcase, but this should be a safe and non-functional change. We have checked the `hasDefaultArg` before calling `getDefaultArg()`, but `hasDefaultArg` allows unparsed/uninstantiated default arg which is prohibited in `getDefaultArg()`. Since we're only interested in the source location, we switch to use `getDefaultArgRange()` API.
1 parent 4490003 commit fec4716

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,7 @@ struct ConvertConstructorToDeductionGuideTransform {
25982598
// placeholder to indicate there is a default argument.
25992599
QualType ParamTy = NewDI->getType();
26002600
NewDefArg = new (SemaRef.Context)
2601-
OpaqueValueExpr(OldParam->getDefaultArg()->getBeginLoc(),
2601+
OpaqueValueExpr(OldParam->getDefaultArgRange().getBegin(),
26022602
ParamTy.getNonLValueExprType(SemaRef.Context),
26032603
ParamTy->isLValueReferenceType() ? VK_LValue
26042604
: ParamTy->isRValueReferenceType() ? VK_XValue

0 commit comments

Comments
 (0)