]> granicus.if.org Git - clang/commit
When determining a standard conversion sequence involves resolving the
authorDouglas Gregor <dgregor@apple.com>
Thu, 29 Apr 2010 18:24:40 +0000 (18:24 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 29 Apr 2010 18:24:40 +0000 (18:24 +0000)
commitad4e02f1711e5e90f4e653397b626e0d1929002c
tree2d8db59a76fc22c9e5dfef1f21b215125077702b
parent9d8463253a073f94af5c3892240c43cad86f3dac
When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102650 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Expr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaOverload.cpp
test/CodeGenCXX/address-of-fntemplate.cpp