static void const *strings[4];
static void const *tpls[4];
static unsigned pos = 0;
static int fail;
static void const *ptr = 0;
void unover (char const (*)[5]) {}
void foo (char const (*)[5]) {}
void foo (void *) {fail = 1;}
void foo (void const *) {fail = 1;}
void baz (char const (&)[5]) {}
template<unsigned I> void PV (char const (&objRef)[I])
{
strings[pos] = objRef;
tpls[pos] = __PRETTY_FUNCTION__;
pos++;
}
void fn ()
{
PV (__FUNCTION__);
PV (__func__);
PV (__PRETTY_FUNCTION__);
PV ("wibble");
}
void baz ()
{
ptr = __FUNCTION__;
if (ptr == "baz")
fail = 1;
if (ptr != __FUNCTION__)
fail = 1;
}
int baz (int)
{
return ptr == __FUNCTION__;
}
int main ()
{
foo (&__FUNCTION__);
baz (__FUNCTION__);
unover (&__FUNCTION__);
if (fail)
return 1;
baz ();
if (fail)
return 1;
if (baz (1))
return 1;
fn ();
if (strings[0] == strings[1])
return 1;
if (strings[0] == strings[2])
return 1;
if (strings[1] == strings[2])
return 1;
if (tpls[0] != tpls[1])
return 1;
if (tpls[0] == tpls[2])
return 1;
return 0;
}