summaryrefslogtreecommitdiff
path: root/c,cc/self_referencing_struct.cc
blob: c084164e69b505e05b9b39bd05741c00cc668dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <vector>

using namespace std;

struct S {
  int m;
  vector<S> v;
};

int
main(void)
{
  S a;
  S b;
  a.v.push_back(b);
  return 0;
}