]> granicus.if.org Git - clang/commit
Make integral-o-pointer conversions in SFINAE illegal.
authorErich Keane <erich.keane@intel.com>
Thu, 17 Jan 2019 23:11:15 +0000 (23:11 +0000)
committerErich Keane <erich.keane@intel.com>
Thu, 17 Jan 2019 23:11:15 +0000 (23:11 +0000)
commit0a4307de1174f61c465c94111f8376d3f5ed548e
tree406a92784f77d6e8b6f9903e18aa9851e1cd1d9d
parent08d0c133ccb1b530ed743a021dc5995fbcdaf012
Make integral-o-pointer conversions in SFINAE illegal.

As reported in PR40362, allowing the conversion from an integral to a
pointer type (despite being illegal in the C++ standard) will cause
surprsing results when testing for certain behaviors in SFINAE.  This
patch converts the error to a SFINAE Error and adds a test to ensure
that it is still a warning in non-SFINAE but an error in it.

Change-Id: I1f475637fa4d83217ae37dc6b5dbf653e118fae4

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351495 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
test/SemaCXX/int-ptr-cast-SFINAE.cpp [new file with mode: 0644]