Skip to content

Commit 7508438

Browse files
authored
[BoundsSafety] Minor fixes on counted_by (llvm#87559)
DeclRef to field must be marked as LValue to be consistent with how the field decl will be evaluated. T->desugar() is unnecessary to call ->isArrayType().
1 parent 20433e9 commit 7508438

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/AST/TypePrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,14 +1763,14 @@ static void printCountAttributedImpl(const CountAttributedType *T,
17631763
void TypePrinter::printCountAttributedBefore(const CountAttributedType *T,
17641764
raw_ostream &OS) {
17651765
printBefore(T->desugar(), OS);
1766-
if (!T->desugar()->isArrayType())
1766+
if (!T->isArrayType())
17671767
printCountAttributedImpl(T, OS, Policy);
17681768
}
17691769

17701770
void TypePrinter::printCountAttributedAfter(const CountAttributedType *T,
17711771
raw_ostream &OS) {
17721772
printAfter(T->desugar(), OS);
1773-
if (T->desugar()->isArrayType())
1773+
if (T->isArrayType())
17741774
printCountAttributedImpl(T, OS, Policy);
17751775
}
17761776

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
27512751
QualType type = VD->getType().getNonReferenceType();
27522752
// This will eventually be translated into MemberExpr upon
27532753
// the use of instantiated struct fields.
2754-
return BuildDeclRefExpr(VD, type, VK_PRValue, NameLoc);
2754+
return BuildDeclRefExpr(VD, type, VK_LValue, NameLoc);
27552755
}
27562756
}
27572757
}

0 commit comments

Comments
 (0)