diff options
author | Daniel Jasper <djasper@google.com> | 2015-03-04 14:18:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-03-04 14:18:20 +0000 |
commit | ad8d849f48c4301cb34fd54715135241531419da (patch) | |
tree | db3dfee2be72cce331cb1d9fb013dbf2f1d0720e /clang/lib/Sema/SemaChecking.cpp | |
parent | b37b95ed3eff809ccb45fcdce1fca61978f21953 (diff) | |
download | bcm5719-llvm-ad8d849f48c4301cb34fd54715135241531419da.tar.gz bcm5719-llvm-ad8d849f48c4301cb34fd54715135241531419da.zip |
Move one more diagnostic into the new -Wformat-pedantic group.
This was apparently overlooked in r231211.
llvm-svn: 231242
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 6b569b63756..884bd7ddbba 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -3768,16 +3768,18 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, CharSourceRange SpecRange = getSpecifierRange(StartSpecifier, SpecifierLen); if (IntendedTy == ExprTy && !ShouldNotPrintDirectly) { + unsigned diag = diag::warn_format_conversion_argument_type_mismatch; + if (match == analyze_format_string::ArgType::NoMatchPedantic) { + diag = diag::warn_format_conversion_argument_type_mismatch_pedantic; + } // In this case, the specifier is wrong and should be changed to match // the argument. - EmitFormatDiagnostic( - S.PDiag(diag::warn_format_conversion_argument_type_mismatch) - << AT.getRepresentativeTypeName(S.Context) << IntendedTy << IsEnum - << E->getSourceRange(), - E->getLocStart(), - /*IsStringLocation*/false, - SpecRange, - FixItHint::CreateReplacement(SpecRange, os.str())); + EmitFormatDiagnostic(S.PDiag(diag) + << AT.getRepresentativeTypeName(S.Context) + << IntendedTy << IsEnum << E->getSourceRange(), + E->getLocStart(), + /*IsStringLocation*/ false, SpecRange, + FixItHint::CreateReplacement(SpecRange, os.str())); } else { // The canonical type for formatting this value is different from the |