History log of /external/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
211f9a485c4b13c61553d55a7bc662e1506b28fd 12-Jul-2016 Marshall Clow <mclow.lists@gmail.com> Add more tests for LWG#2582. No code changes needed, just tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@275211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
7490f53118156f446b61583b7f0af0847b5942d7 25-Feb-2016 Marshall Clow <mclow.lists@gmail.com> Added tests to make sure that the categorization traits work on incomplete types

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@261925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
89465dce7c16d2108fdf0b64fe6b3e7388c3a24e 18-Feb-2015 Eric Fiselier <eric@efcs.ca> [libc++] Fix PR20084 - std::is_function<void() const> failed.

Summary:
This patch introduces some black magic to detect const and volatile qualified function types such as `void () const`.

The patch works in the following way:

We first rule out any type that satisfies on of the following. These restrictions are important so that the test below works properly.
* `is_class<_Tp>::value`
* `is_union<_Tp>::value`
* `is_void<_Tp>::value`
* `is_reference<_Tp>::value`
* `__is_nullptr_t<_Tp>::value`


If none of the above is true we perform overload resolution on `__source<_Tp>(0)` to determine the return type.
* If `_Tp&` is well-formed we select `_Tp& __source(int)`. `_Tp&` is only ill formed for cv void types and cv/ref qualified function types.
* Otherwise we select `__dummy_type __source(...)`. Since we know `_Tp` cannot be void then it must be a function type.


let `R` be the returned from `__source<_Tp>(0)`.
We perform overload resolution on `__test<_Tp>(R)`.
* If `R` is `__dummy_type` we call `true_type __test(__dummy_type)`.
* if `R` is `_Tp&` and `_Tp&` decays to `_Tp*` we call `true_type __test(_Tp*)`. Only references to function types decay to a pointer of the same type.
* In all other cases we call `false_type __test(...)`.

`__source<_Tp>(0)` will try and form `_Tp&` in the return type. if `_Tp&` is not well formed the return type of `__source<_Tp>(0)` will be dummy type. `_Tp&` is only ill-formed for cv/ref qualified function types (and void which is dealt with elsewhere).


This fixes PR20084 - http://llvm.org/bugs/show_bug.cgi?id=20084

Reviewers: rsmith, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
a90c6dd46005b2b14de3bb889a8d03bb34bd3256 20-Dec-2014 Eric Fiselier <eric@efcs.ca> Move test into test/std subdirectory.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp