aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Program.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-06-12 13:59:32 +0000
committerErich Keane <erich.keane@intel.com>2018-06-12 13:59:32 +0000
commit2fcbe9283fb9fa00ab2a3edb9574c2fcf0aba086 (patch)
tree35cf3df99d807c475cdb3b200b7b0719b9bc9a5b /llvm/lib/Support/Program.cpp
parent3827537abc6381c5a3c4bb09ce3842644ba9d0be (diff)
downloadllvm-2fcbe9283fb9fa00ab2a3edb9574c2fcf0aba086.zip
llvm-2fcbe9283fb9fa00ab2a3edb9574c2fcf0aba086.tar.gz
llvm-2fcbe9283fb9fa00ab2a3edb9574c2fcf0aba086.tar.bz2
Fix overload resolution between Ptr-To-Member and Bool
As reported here (https://bugs.llvm.org/show_bug.cgi?id=19808) and discovered independently when looking at plum-hall tests, we incorrectly implemented over.ics.rank, which says "A conversion that is not a conversion of a pointer, or pointer to member, to bool is better than another conversion that is such a conversion.". In the current Draft (N4750), this is phrased slightly differently in paragraph 4.1: A conversion that does not convert a pointer, a pointer to member, or std::nullptr_t to bool is better than one that does. The comment on isPointerConversionToBool (the changed function) also confirms that this is the case (note outdated reference): isPointerConversionToBool - Determines whether this conversion is a conversion of a pointer or pointer-to-member to bool. This is used as part of the ranking of standard conversion sequences (C++ 13.3.3.2p4). However, despite this comment, it didn't check isMemberPointerType on the 'FromType', presumably incorrectly assuming that 'isPointerType' matched it. This patch fixes this by adding isMemberPointerType to this function. Additionally, member function pointers are just MemberPointerTypes that point to functions insted of data, so that is fixed in this patch as well. llvm-svn: 334503
Diffstat (limited to 'llvm/lib/Support/Program.cpp')
0 files changed, 0 insertions, 0 deletions