diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-20 00:27:40 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-20 00:27:40 +0000 |
| commit | f7ec86a55bbabd42780d94e9e9a80ce45491e19b (patch) | |
| tree | 5b4e421de7775d0d5e4f4238ab8e867259ac04e2 /clang/lib/Sema/SemaChecking.cpp | |
| parent | b523b9c8d4629267fbcde3781f33f133153f7da3 (diff) | |
| download | bcm5719-llvm-f7ec86a55bbabd42780d94e9e9a80ce45491e19b.tar.gz bcm5719-llvm-f7ec86a55bbabd42780d94e9e9a80ce45491e19b.zip | |
PR17290: Use 'false' macro in fix-it hint for initializing a variable of type
_Bool in C, if the macro is defined. Also teach FixItUtils to look at whether
the macro was defined at the source location for which it is creating a fixit,
rather than looking at whether it's defined *now*. This is especially relevant
for analysis-based warnings which are delayed until end of TU.
llvm-svn: 191057
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index a4fb3cfa45c..426bf68e1d6 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5328,7 +5328,8 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, if (!Loc.isMacroID() || CC.isMacroID()) S.Diag(Loc, diag::warn_impcast_null_pointer_to_integer) << T << clang::SourceRange(CC) - << FixItHint::CreateReplacement(Loc, S.getFixItZeroLiteralForType(T)); + << FixItHint::CreateReplacement(Loc, + S.getFixItZeroLiteralForType(T, Loc)); } if (!Source->isIntegerType() || !Target->isIntegerType()) |

