diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-04-30 18:27:22 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-04-30 18:27:22 +0000 |
commit | 2c0abf4ae33ab2ba690ccae724b8d6f196e7cfda (patch) | |
tree | b180f1506831cf95f7d9df8b29a3461ef617048a /lib/Sema/SemaChecking.cpp | |
parent | c1c0725978ed31253af5ef4849a124e8fc13ebbb (diff) |
Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.
Reviewed by Doug Gregor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index d12f707218..a9557a5474 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -4220,7 +4220,8 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, if (Loc.isMacroID()) Loc = S.SourceMgr.getImmediateExpansionRange(Loc).first; S.Diag(Loc, diag::warn_impcast_null_pointer_to_integer) - << T << Loc << clang::SourceRange(CC); + << T << clang::SourceRange(CC) + << FixItHint::CreateReplacement(Loc, S.getFixItZeroLiteralForType(T)); return; } |