Constrain __invoke functions more accurately. This fixes http://llvm.org/bugs/show_bug.cgi?id=15861 .

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2013-05-07 23:40:12 +00:00
parent 5f1286f574
commit ecc9742f27
3 changed files with 47 additions and 8 deletions

View File

@@ -28,6 +28,12 @@ struct S
typedef void (S::*PMS)(long) const;
typedef char S::*PMD;
struct wat
{
wat& operator*() { return *this; }
void foo();
};
int main()
{
static_assert((std::is_same<std::result_of<S(int)>::type, short>::value), "Error!");
@@ -40,4 +46,5 @@ int main()
static_assert((std::is_same<std::result_of<PMD(S)>::type, char&&>::value), "Error!");
#endif
static_assert((std::is_same<std::result_of<PMD(const S*)>::type, const char&>::value), "Error!");
using type = std::result_of<decltype(&wat::foo)(wat)>::type;
}