aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/FormatString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/FormatString.cpp')
-rw-r--r--lib/Analysis/FormatString.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp
index a68b9bb324..f03a84fb52 100644
--- a/lib/Analysis/FormatString.cpp
+++ b/lib/Analysis/FormatString.cpp
@@ -262,6 +262,13 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
argTy = ETy->getDecl()->getIntegerType();
argTy = C.getCanonicalType(argTy).getUnqualifiedType();
+ if (const PointerType *PTy = argTy->getAs<PointerType>()) {
+ // Strip volatile qualifier from pointee type.
+ QualType Pointee = PTy->getPointeeType();
+ Pointee.removeLocalVolatile();
+ argTy = C.getPointerType(Pointee);
+ }
+
if (T == argTy)
return true;
// Check for "compatible types".