Beispiel #1
0
void bar (A a)
{
  // Decltype is also a C++ 11 feature.
  // Verify that decltype gets the right type and that foo is
  // mangled correctly.
  foo<decltype (a.a)>();

  // Verify that function templates taking a reference and an rvalue
  // references (as in PR c++/69277) are also mangled correctly.
  fooref (a.a);
  foorefref (a.a);
}
int main()
{

  int y;
  int *ptr = &y;
  foo f(ptr);
  *ptr;

  //foo& fooref(ptr);    // this does not compile
  foo& fooref(foo);      // this is viewed as a function prototype
  //foo& fooref(foo) {}  // a function definition is not allowed
  foo& fooref2 = f;  // call to a copy constructor?

  int z;
  foo* fooptr = new foo(&z);

  return 0;
}