Fix -use-nullptr problems with assert()
authorEdwin Vane <edwin.vane@intel.com>
Sun, 17 Feb 2013 16:45:54 +0000 (16:45 +0000)
committerEdwin Vane <edwin.vane@intel.com>
Sun, 17 Feb 2013 16:45:54 +0000 (16:45 +0000)
commit4ad00b46fbb0bfe2530b6cdd8803937166bfa80f
tree4ed87ff128357e28d7ae702f1b94d68fa7c4fd9b
parent1cba0a8e0aea9758a066bb8802020ee8f6502b06
Fix -use-nullptr problems with assert()

If a cast expression (NullToPointer) is detected in a function-like macro
parameter, we should use the spelling location instead of the expansion
location. Using SourceManager::getFileLoc() fixes this problem.

Also added testcases for this bug.

Fixes: PR15279
Author: Tareq A Siraj <tareq.a.siraj@intel.com>
Reviewer: klimek
llvm-svn: 175399
clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp
clang-tools-extra/test/cpp11-migrate/UseNullptr/basic.cpp