fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo { int x{}; };
  5.  
  6. Foo MakeFoo() { return {}; }
  7.  
  8. int main() {
  9. // decltype(bar) != Foo, but something else...
  10. auto bar(MakeFoo());
  11. bar.x = 42;
  12. return 0;
  13. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
Standard output is empty