blob: 7c4e23f40ff28626edd5c65dcd600b53786f4534 [file] [log] [blame]
Chris Lattner4e44c0e2003-09-29 21:53:04 +00001// Non-POD classes cannot be passed into a function by component, because their
2// dtors must be run. Instead, pass them in by reference. The C++ front-end
3// was mistakenly "thinking" that 'foo' took a structure by component.
4
Chris Lattner0f44ad32003-09-29 21:18:36 +00005struct C {
6 int A, B;
7 ~C() {}
Chris Lattner0f44ad32003-09-29 21:18:36 +00008};
9
Chris Lattner4e44c0e2003-09-29 21:53:04 +000010void foo(C b);
11
Chris Lattner0f44ad32003-09-29 21:18:36 +000012void test(C *P) {
Chris Lattner4e44c0e2003-09-29 21:53:04 +000013 foo(*P);
Chris Lattner0f44ad32003-09-29 21:18:36 +000014}
15