File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2679,7 +2679,7 @@ struct ConvertConstructorToDeductionGuideTransform {
2679
2679
// placeholder to indicate there is a default argument.
2680
2680
QualType ParamTy = NewDI->getType();
2681
2681
NewDefArg = new (SemaRef.Context)
2682
- OpaqueValueExpr(OldParam->getDefaultArg()->getBeginLoc (),
2682
+ OpaqueValueExpr(OldParam->getDefaultArgRange().getBegin (),
2683
2683
ParamTy.getNonLValueExprType(SemaRef.Context),
2684
2684
ParamTy->isLValueReferenceType() ? VK_LValue
2685
2685
: ParamTy->isRValueReferenceType() ? VK_XValue
Original file line number Diff line number Diff line change @@ -54,3 +54,18 @@ template<class T, class B> struct Y { Y(T); };
54
54
template <class T , class B =void > struct Y ;
55
55
Y y (1 );
56
56
}
57
+
58
+ namespace NoCrashOnGettingDefaultArgLoc {
59
+ template <typename >
60
+ class A {
61
+ A (int = 1 ); // expected-note {{candidate template ignored: couldn't infer template argumen}}
62
+ };
63
+ class C : A<int > {
64
+ using A::A;
65
+ };
66
+ template <typename >
67
+ class D : C { // expected-note {{candidate function template not viable: requires 1 argument}}
68
+ using C::C;
69
+ };
70
+ D abc; // expected-error {{no viable constructor or deduction guide}}
71
+ }
You can’t perform that action at this time.
0 commit comments