@@ -5566,8 +5566,8 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
5566
5566
}
5567
5567
}
5568
5568
5569
- static bool EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, QualType LhsT ,
5570
- QualType RhsT , SourceLocation KeyLoc);
5569
+ static bool EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, const TypeSourceInfo *Lhs ,
5570
+ const TypeSourceInfo *Rhs , SourceLocation KeyLoc);
5571
5571
5572
5572
static bool EvaluateBooleanTypeTrait (Sema &S, TypeTrait Kind,
5573
5573
SourceLocation KWLoc,
@@ -5583,8 +5583,8 @@ static bool EvaluateBooleanTypeTrait(Sema &S, TypeTrait Kind,
5583
5583
// Evaluate ReferenceBindsToTemporary and ReferenceConstructsFromTemporary
5584
5584
// alongside the IsConstructible traits to avoid duplication.
5585
5585
if (Kind <= BTT_Last && Kind != BTT_ReferenceBindsToTemporary && Kind != BTT_ReferenceConstructsFromTemporary)
5586
- return EvaluateBinaryTypeTrait (S, Kind, Args[0 ]-> getType () ,
5587
- Args[1 ]-> getType () , RParenLoc);
5586
+ return EvaluateBinaryTypeTrait (S, Kind, Args[0 ],
5587
+ Args[1 ], RParenLoc);
5588
5588
5589
5589
switch (Kind) {
5590
5590
case clang::BTT_ReferenceBindsToTemporary:
@@ -5679,8 +5679,8 @@ static bool EvaluateBooleanTypeTrait(Sema &S, TypeTrait Kind,
5679
5679
if (U->isReferenceType ())
5680
5680
return false ;
5681
5681
5682
- QualType TPtr = S.Context .getPointerType (S.BuiltinRemoveReference (T, UnaryTransformType::RemoveCVRef, {}));
5683
- QualType UPtr = S.Context .getPointerType (S.BuiltinRemoveReference (U, UnaryTransformType::RemoveCVRef, {}));
5682
+ TypeSourceInfo * TPtr = S.Context .CreateTypeSourceInfo (S. Context . getPointerType (S.BuiltinRemoveReference (T, UnaryTransformType::RemoveCVRef, {}) ));
5683
+ TypeSourceInfo * UPtr = S.Context .CreateTypeSourceInfo (S. Context . getPointerType (S.BuiltinRemoveReference (U, UnaryTransformType::RemoveCVRef, {}) ));
5684
5684
return EvaluateBinaryTypeTrait (S, TypeTrait::BTT_IsConvertibleTo, UPtr, TPtr, RParenLoc);
5685
5685
}
5686
5686
@@ -5814,8 +5814,11 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc,
5814
5814
return BuildTypeTrait (Kind, KWLoc, ConvertedArgs, RParenLoc);
5815
5815
}
5816
5816
5817
- static bool EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, QualType LhsT,
5818
- QualType RhsT, SourceLocation KeyLoc) {
5817
+ static bool EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, const TypeSourceInfo *Lhs,
5818
+ const TypeSourceInfo *Rhs, SourceLocation KeyLoc) {
5819
+ QualType LhsT = Lhs->getType ();
5820
+ QualType RhsT = Rhs->getType ();
5821
+
5819
5822
assert (!LhsT->isDependentType () && !RhsT->isDependentType () &&
5820
5823
" Cannot evaluate traits of dependent types" );
5821
5824
0 commit comments