Skip to content

Commit 490b7d1

Browse files
authored
[clang][NFC] Pass const ASTContext& to CXXTypeidExpr API (#113083)
1 parent 5a47d48 commit 490b7d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,13 @@ class CXXTypeidExpr : public Expr {
876876

877877
/// Best-effort check if the expression operand refers to a most derived
878878
/// object. This is not a strong guarantee.
879-
bool isMostDerived(ASTContext &Context) const;
879+
bool isMostDerived(const ASTContext &Context) const;
880880

881881
bool isTypeOperand() const { return Operand.is<TypeSourceInfo *>(); }
882882

883883
/// Retrieves the type operand of this typeid() expression after
884884
/// various required adjustments (removing reference types, cv-qualifiers).
885-
QualType getTypeOperand(ASTContext &Context) const;
885+
QualType getTypeOperand(const ASTContext &Context) const;
886886

887887
/// Retrieve source information for the type operand.
888888
TypeSourceInfo *getTypeOperandSourceInfo() const {

clang/lib/AST/ExprCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool CXXTypeidExpr::isPotentiallyEvaluated() const {
147147
return false;
148148
}
149149

150-
bool CXXTypeidExpr::isMostDerived(ASTContext &Context) const {
150+
bool CXXTypeidExpr::isMostDerived(const ASTContext &Context) const {
151151
assert(!isTypeOperand() && "Cannot call isMostDerived for typeid(type)");
152152
const Expr *E = getExprOperand()->IgnoreParenNoopCasts(Context);
153153
if (const auto *DRE = dyn_cast<DeclRefExpr>(E)) {
@@ -159,7 +159,7 @@ bool CXXTypeidExpr::isMostDerived(ASTContext &Context) const {
159159
return false;
160160
}
161161

162-
QualType CXXTypeidExpr::getTypeOperand(ASTContext &Context) const {
162+
QualType CXXTypeidExpr::getTypeOperand(const ASTContext &Context) const {
163163
assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)");
164164
Qualifiers Quals;
165165
return Context.getUnqualifiedArrayType(

0 commit comments

Comments
 (0)