This is an archive of the discontinued LLVM Phabricator instance.

Remove redundant check for value dependency of null pointer constant
Needs ReviewPublic

Authored by dyp-cpp on May 31 2015, 5:20 PM.

Details

Summary

In SemaOverload.cpp, the isNullPointerConstantForConversion function contains a redundant check for value dependency of a null pointer constant. The same check is performed in Expr::isNullPointerConstant, where the implementation is adapted to various special cases and better maintained. E.g. in C++11 and C++14 modes, the version in SemaOverload.cpp yields wrong results.

As it turned out, the test case for PR20110 already contained a note that this test should actually fail in C++11 mode. I've split this test case into two files for C++03 mode (which reproduces the original behaviour) and C++11 mode (new behaviour).

Diff Detail

Event Timeline

dyp-cpp updated this revision to Diff 26865.May 31 2015, 5:20 PM
dyp-cpp retitled this revision from to Remove redundant check for value dependency of null pointer constant.
dyp-cpp updated this object.
dyp-cpp edited the test plan for this revision. (Show Details)
dyp-cpp added reviewers: rsmith, doug.gregor.
dyp-cpp added a subscriber: Unknown Object (MLST).