http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46778
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-12-03
11:32:00 UTC ---
the test looks valid to me, this simpler version is also rejected
template<typename _Tp>
class is_constructible_mini2
{
typedef char __one;
typedef struct { char __arr[2]; } __two;
template<typename _Tp1>
static decltype(_Tp1(), __one())
__test(int);
template<typename>
static __two __test(...);
public:
static const bool value = sizeof(__test<_Tp>(0)) == 1;
};
int t1[is_constructible_mini2<int&>::value ? -1 : 1];
int t2[is_constructible_mini2<const int&>::value ? -1 : 1];