Dan Gohman | 2d65d35 | 2009-08-25 15:38:29 +0000 | [diff] [blame] | 1 | // RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 2 | |
3 | // Non-POD classes cannot be passed into a function by component, because their | ||||
4 | // dtors must be run. Instead, pass them in by reference. The C++ front-end | ||||
5 | // was mistakenly "thinking" that 'foo' took a structure by component. | ||||
6 | |||||
7 | struct C { | ||||
8 | int A, B; | ||||
9 | ~C() {} | ||||
10 | }; | ||||
11 | |||||
12 | void foo(C b); | ||||
13 | |||||
14 | void test(C *P) { | ||||
15 | foo(*P); | ||||
16 | } | ||||
17 |