// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-std=c++0x" }
|
// { dg-options "-std=c++0x" }
|
template
|
template
|
struct is_same
|
struct is_same
|
{
|
{
|
static const bool value = false;
|
static const bool value = false;
|
};
|
};
|
|
|
template
|
template
|
struct is_same
|
struct is_same
|
{
|
{
|
static const bool value = true;
|
static const bool value = true;
|
};
|
};
|
|
|
int&& f(const int&) {}
|
int&& f(const int&) {}
|
int&& (*fp)(const int&) = f;
|
int&& (*fp)(const int&) = f;
|
int&& (&fr)(const int&) = f;
|
int&& (&fr)(const int&) = f;
|
|
|
struct X { int&& f(const int&); };
|
struct X { int&& f(const int&); };
|
|
|
int&& (X::*mfp)(const int&) = &X::f;
|
int&& (X::*mfp)(const int&) = &X::f;
|
|
|
void g(X& xr, X* xp)
|
void g(X& xr, X* xp)
|
{
|
{
|
int i;
|
int i;
|
static_assert(is_same::value, "direct call");
|
static_assert(is_same::value, "direct call");
|
static_assert(is_same::value, "pointer");
|
static_assert(is_same::value, "pointer");
|
static_assert(is_same::value,
|
static_assert(is_same::value,
|
"dereferenced pointer");
|
"dereferenced pointer");
|
static_assert(is_same::value,
|
static_assert(is_same::value,
|
"reference");
|
"reference");
|
static_assert(is_same::value,
|
static_assert(is_same::value,
|
"member function call");
|
"member function call");
|
static_assert(is_same::value,
|
static_assert(is_same::value,
|
"member function pointer with .*");
|
"member function pointer with .*");
|
static_assert(is_same*mfp)(i)), int&&>::value,
|
static_assert(is_same*mfp)(i)), int&&>::value,
|
"member function pointer with ->*");
|
"member function pointer with ->*");
|
}
|
}
|
|
|