diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-08-07 08:59:46 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-08-07 08:59:46 +0000 |
commit | 58e1e54476d610d6c33ef483f216ed8a1282d35c (patch) | |
tree | 53ddc9b5444c8e4da14bfcf799a740466ed66a3d /lib/Sema/SemaChecking.cpp | |
parent | 5d435b6001fb853747426bfa47b0e0f49a736fe4 (diff) |
Remove ScanfArgType and bake that logic into ArgType.
This is useful for example for %n in printf, which expects
a pointer to int with the same logic for checking as %d
would have in scanf.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index e699f00479..5e4309195e 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2800,8 +2800,8 @@ bool CheckScanfHandler::HandleScanfSpecifier( if (!Ex) return true; - const analyze_scanf::ScanfArgType &ATR = FS.getArgType(S.Context); - if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) { + const analyze_format_string::ArgType &AT = FS.getArgType(S.Context); + if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType())) { ScanfSpecifier fixedFS = FS; bool success = fixedFS.fixType(Ex->getType(), S.getLangOpts(), S.Context); @@ -2814,7 +2814,7 @@ bool CheckScanfHandler::HandleScanfSpecifier( EmitFormatDiagnostic( S.PDiag(diag::warn_printf_conversion_argument_type_mismatch) - << ATR.getRepresentativeTypeName(S.Context) << Ex->getType() + << AT.getRepresentativeTypeName(S.Context) << Ex->getType() << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/false, @@ -2825,7 +2825,7 @@ bool CheckScanfHandler::HandleScanfSpecifier( } else { EmitFormatDiagnostic( S.PDiag(diag::warn_printf_conversion_argument_type_mismatch) - << ATR.getRepresentativeTypeName(S.Context) << Ex->getType() + << AT.getRepresentativeTypeName(S.Context) << Ex->getType() << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/false, |