[clang][NFC] Remove unused CastForMoving parameter
authorTimm Bäder <tbaeder@redhat.com>
Mon, 14 Nov 2022 15:35:23 +0000 (16:35 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Wed, 16 Nov 2022 09:02:52 +0000 (10:02 +0100)
Nothing ever passes a third parameter to CastForMoving.

clang/lib/Sema/SemaDeclCXX.cpp

index a15824f..0ea99a8 100644 (file)
@@ -4691,10 +4691,10 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo,
 }
 
 // Create a static_cast\<T&&>(expr).
-static Expr *CastForMoving(Sema &SemaRef, Expr *E, QualType T = QualType()) {
-  if (T.isNull()) T = E->getType();
-  QualType TargetType = SemaRef.BuildReferenceType(
-      T, /*SpelledAsLValue*/false, SourceLocation(), DeclarationName());
+static Expr *CastForMoving(Sema &SemaRef, Expr *E) {
+  QualType TargetType =
+      SemaRef.BuildReferenceType(E->getType(), /*SpelledAsLValue*/ false,
+                                 SourceLocation(), DeclarationName());
   SourceLocation ExprLoc = E->getBeginLoc();
   TypeSourceInfo *TargetLoc = SemaRef.Context.getTrivialTypeSourceInfo(
       TargetType, ExprLoc);