fork download
  1. #include <iostream>
  2.  
  3. class Foo {
  4. struct Bar { int i; };
  5. typedef Bar return_type_from_Baz;
  6. public:
  7. return_type_from_Baz Baz() { return Bar(); }
  8. };
  9.  
  10. int main() {
  11. Foo f;
  12. // Foo::Bar b = f.Baz(); // error
  13. auto b = f.Baz(); // ok
  14. std::cout << b.i;
  15. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
0