]> granicus.if.org Git - clang/commit
[Sema] Fix address-of + enable_if overloading logic
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 16 Oct 2015 01:17:38 +0000 (01:17 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 16 Oct 2015 01:17:38 +0000 (01:17 +0000)
commit3947fa32ce1130020e7cd76a725d5b7f744a1ccd
tree78ba25cc31d301cb7f413d355a79eafbf065191e
parenta0bd79c879e4ea58ee9e5494991c5c6f3e7c29e9
[Sema] Fix address-of + enable_if overloading logic

Previously, our logic when taking the address of an overloaded function
would not consider enable_if attributes, so long as all of the enable_if
conditions on a given candidate were true. So, two functions with
identical signatures (one with enable_if attributes, the other without),
would be considered equally good overloads. If we were calling the
function instead of taking its address, then the function with enable_if
attributes would be preferred.

This patch makes us prefer the candidate with enable_if regardless of if
we're calling or taking the address of an overloaded function.

Differential Revision: http://reviews.llvm.org/D13795

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250486 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/CodeGen/enable_if.c
test/CodeGenCXX/enable_if.cpp
test/Sema/enable_if.c
test/SemaCXX/enable_if.cpp