diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -810,7 +810,7 @@ checkSuspensionContext(*this, Loc, "co_await"); - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult R = CheckPlaceholderExpr(E); if (R.isInvalid()) return ExprError(); E = R.get(); @@ -828,7 +828,7 @@ if (!FSI) return ExprError(); - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult R = CheckPlaceholderExpr(E); if (R.isInvalid()) return ExprError(); @@ -866,7 +866,7 @@ if (!Coroutine) return ExprError(); - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult R = CheckPlaceholderExpr(E); if (R.isInvalid()) return ExprError(); E = R.get(); @@ -927,7 +927,7 @@ if (!Coroutine) return ExprError(); - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult R = CheckPlaceholderExpr(E); if (R.isInvalid()) return ExprError(); E = R.get(); @@ -970,8 +970,8 @@ if (!FSI) return StmtError(); - if (E && E->getType()->isPlaceholderType() && - !E->getType()->isSpecificPlaceholderType(BuiltinType::Overload)) { + if (E && E->hasPlaceholderType() && + !E->hasPlaceholderType(BuiltinType::Overload)) { ExprResult R = CheckPlaceholderExpr(E); if (R.isInvalid()) return StmtError(); E = R.get(); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -497,7 +497,7 @@ /// DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4). ExprResult Sema::DefaultFunctionArrayConversion(Expr *E, bool Diagnose) { // Handle any placeholder expressions which made it here. - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult result = CheckPlaceholderExpr(E); if (result.isInvalid()) return ExprError(); E = result.get(); @@ -621,7 +621,7 @@ ExprResult Sema::DefaultLvalueConversion(Expr *E) { // Handle any placeholder expressions which made it here. - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult result = CheckPlaceholderExpr(E); if (result.isInvalid()) return ExprError(); E = result.get(); @@ -4685,7 +4685,7 @@ Sema::ActOnArraySubscriptExpr(Scope *S, Expr *base, SourceLocation lbLoc, Expr *idx, SourceLocation rbLoc) { if (base && !base->getType().isNull() && - base->getType()->isSpecificPlaceholderType(BuiltinType::OMPArraySection)) + base->hasPlaceholderType(BuiltinType::OMPArraySection)) return ActOnOMPArraySectionExpr(base, lbLoc, idx, SourceLocation(), SourceLocation(), /*Length*/ nullptr, /*Stride=*/nullptr, rbLoc); @@ -4711,8 +4711,7 @@ }; // The matrix subscript operator ([][])is considered a single operator. // Separating the index expressions by parenthesis is not allowed. - if (base->getType()->isSpecificPlaceholderType( - BuiltinType::IncompleteMatrixIdx) && + if (base->hasPlaceholderType(BuiltinType::IncompleteMatrixIdx) && !isa(base)) { Diag(base->getExprLoc(), diag::err_matrix_separate_incomplete_index) << SourceRange(base->getBeginLoc(), rbLoc); @@ -4944,9 +4943,8 @@ SourceLocation ColonLocSecond, Expr *Length, Expr *Stride, SourceLocation RBLoc) { - if (Base->getType()->isPlaceholderType() && - !Base->getType()->isSpecificPlaceholderType( - BuiltinType::OMPArraySection)) { + if (Base->hasPlaceholderType() && + !Base->hasPlaceholderType(BuiltinType::OMPArraySection)) { ExprResult Result = CheckPlaceholderExpr(Base); if (Result.isInvalid()) return ExprError(); @@ -5114,8 +5112,7 @@ } } - if (!Base->getType()->isSpecificPlaceholderType( - BuiltinType::OMPArraySection)) { + if (!Base->hasPlaceholderType(BuiltinType::OMPArraySection)) { ExprResult Result = DefaultFunctionArrayLvalueConversion(Base); if (Result.isInvalid()) return ExprError(); @@ -5130,7 +5127,7 @@ SourceLocation RParenLoc, ArrayRef Dims, ArrayRef Brackets) { - if (Base->getType()->isPlaceholderType()) { + if (Base->hasPlaceholderType()) { ExprResult Result = CheckPlaceholderExpr(Base); if (Result.isInvalid()) return ExprError(); @@ -5155,7 +5152,7 @@ SmallVector NewDims; bool ErrorFound = false; for (Expr *Dim : Dims) { - if (Dim->getType()->isPlaceholderType()) { + if (Dim->hasPlaceholderType()) { ExprResult Result = CheckPlaceholderExpr(Dim); if (Result.isInvalid()) { ErrorFound = true; @@ -13653,7 +13650,7 @@ if (OrigOp.get()->isTypeDependent()) return Context.DependentTy; - assert(!OrigOp.get()->getType()->isPlaceholderType()); + assert(!OrigOp.get()->hasPlaceholderType()); // Make sure to ignore parentheses in subsequent checks Expr *op = OrigOp.get()->IgnoreParens(); diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -564,7 +564,7 @@ SourceLocation RParenLoc) { bool WasEvaluated = false; if (E && !E->isTypeDependent()) { - if (E->getType()->isPlaceholderType()) { + if (E->hasPlaceholderType()) { ExprResult result = CheckPlaceholderExpr(E); if (result.isInvalid()) return ExprError(); E = result.get(); @@ -5704,7 +5704,7 @@ SourceLocation RParen) { if (Queried->isTypeDependent()) { // Delay type-checking for type-dependent expressions. - } else if (Queried->getType()->isPlaceholderType()) { + } else if (Queried->hasPlaceholderType()) { ExprResult PE = CheckPlaceholderExpr(Queried); if (PE.isInvalid()) return ExprError(); return BuildExpressionTrait(ET, KWLoc, PE.get(), RParen); @@ -5720,8 +5720,7 @@ ExprValueKind &VK, SourceLocation Loc, bool isIndirect) { - assert(!LHS.get()->getType()->isPlaceholderType() && - !RHS.get()->getType()->isPlaceholderType() && + assert(!LHS.get()->hasPlaceholderType() && !RHS.get()->hasPlaceholderType() && "placeholders should have been weeded out by now"); // The LHS undergoes lvalue conversions if this is ->*, and undergoes the