Skip to content

Commit f536c94

Browse files
committed
fix error that reference to PointerType is ambiguous
1 parent 8830e38 commit f536c94

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/Analysis/UnsafeBufferUsage.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
247247

248248
// Because we're dealing with raw pointers, let's define what we mean by that.
249249
static bool hasPointerType(const Expr &E) {
250-
return isa<PointerType>(E.getType().getCanonicalType());
250+
return isa<clang::PointerType>(E.getType().getCanonicalType());
251251
}
252252

253253
static bool hasArrayType(const Expr &E) {
254-
return isa<ArrayType>(E.getType().getCanonicalType());
254+
return isa<clang::ArrayType>(E.getType().getCanonicalType());
255255
}
256256

257257
static void
@@ -968,7 +968,8 @@ static bool hasUnsafePrintfStringArg(const CallExpr &Node, ASTContext &Ctx,
968968
if (!FirstParmTy->isPointerType())
969969
return false; // possibly some user-defined printf function
970970

971-
QualType FirstPteTy = FirstParmTy->castAs<PointerType>()->getPointeeType();
971+
QualType FirstPteTy =
972+
FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
972973

973974
if (!Ctx.getFILEType()
974975
.isNull() && //`FILE *` must be in the context if it is fprintf
@@ -1052,7 +1053,8 @@ static bool hasUnsafeSnprintfBuffer(const CallExpr &Node,
10521053
if (!FirstParmTy->isPointerType())
10531054
return false; // Not an snprint
10541055

1055-
QualType FirstPteTy = FirstParmTy->castAs<PointerType>()->getPointeeType();
1056+
QualType FirstPteTy =
1057+
FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
10561058
const Expr *Buf = Node.getArg(0), *Size = Node.getArg(1);
10571059

10581060
if (FirstPteTy.isConstQualified() || !Buf->getType()->isPointerType() ||

0 commit comments

Comments
 (0)