language: C++11 (gcc-4.7.2)
date: 824 days 8 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <functional>
template <typename T>
class A
{
    typedef decltype(std::bind(&A::f, std::declval<A>())) some_type;
 
    void f();
};
 
template <>
class A<void>
{
    void f();
    typedef decltype(std::bind(&A::f, std::declval<A>())) some_type;
 
};
 
 
int main()
{
  return 0;
}
 
prog.cpp:14:56: error: invalid use of incomplete type 'class A<void>'
prog.cpp:12:1: error: declaration of 'class A<void>'
prog.cpp:14:56: error:   initializing argument 2 of 'std::_Bind<typename std::_Maybe_wrap_member_pointer<_Tp>::type(_ArgTypes ...)> std::bind(_Functor, _ArgTypes ...) [with _Functor = void (A<void>::*)(), _ArgTypes = {A<void>}, typename std::_Maybe_wrap_member_pointer<_Tp>::type = std::_Mem_fn<void (A<void>::*)()>]'
prog.cpp:14:56: error: invalid use of incomplete type 'class A<void>'
prog.cpp:12:1: error: declaration of 'class A<void>'
prog.cpp:14:56: error:   initializing argument 2 of 'std::_Bind<typename std::_Maybe_wrap_member_pointer<_Tp>::type(_ArgTypes ...)> std::bind(_Functor, _ArgTypes ...) [with _Functor = void (A<void>::*)(), _ArgTypes = {A<void>}, typename std::_Maybe_wrap_member_pointer<_Tp>::type = std::_Mem_fn<void (A<void>::*)()>]'