File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -10922,11 +10922,15 @@ struct AliasTemplateDeductionGuideTransform {
10922
10922
// placeholder to indicate there is a default argument.
10923
10923
QualType ParamTy = NewDI->getType ();
10924
10924
NewDefArg = new (SemaRef.Context )
10925
- OpaqueValueExpr(OldParam->getDefaultArg()->getBeginLoc(),
10926
- ParamTy.getNonLValueExprType(SemaRef.Context),
10927
- ParamTy->isLValueReferenceType() ? VK_LValue
10928
- : ParamTy->isRValueReferenceType() ? VK_XValue
10929
- : VK_PRValue);
10925
+ // FIXME: using getDefaultArg will crash hitting "Default argument is
10926
+ // not yet instantiated!" erro, fixed in constructor transformer as
10927
+ // well.
10928
+ OpaqueValueExpr (
10929
+ OldParam->getDefaultArgRange ().getBegin (),
10930
+ ParamTy.getNonLValueExprType (SemaRef.Context ),
10931
+ ParamTy->isLValueReferenceType () ? VK_LValue
10932
+ : ParamTy->isRValueReferenceType () ? VK_XValue
10933
+ : VK_PRValue);
10930
10934
}
10931
10935
10932
10936
ParmVarDecl *NewParam = ParmVarDecl::Create (SemaRef.Context , DC,
Original file line number Diff line number Diff line change @@ -30,3 +30,14 @@ void test2() {
30
30
static_assert (__is_same (decltype (xy.x ), int ));
31
31
static_assert (__is_same (decltype (xy.y ), double ));
32
32
}
33
+
34
+ namespace test3 {
35
+ template <typename T, class >
36
+ struct container {
37
+ // test with default arguments.
38
+ container (T a , T b = T());
39
+ };
40
+
41
+ template <class T > using vector = container<T, int >;
42
+ vector v (0 , 0 );
43
+ } // namespace test3
You can’t perform that action at this time.
0 commit comments