2009-08-25 15:38:29 +00:00
|
|
|
// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null
|
2004-11-06 22:29:57 +00:00
|
|
|
|
2003-09-29 21:53:04 +00:00
|
|
|
// Non-POD classes cannot be passed into a function by component, because their
|
|
|
|
// dtors must be run. Instead, pass them in by reference. The C++ front-end
|
|
|
|
// was mistakenly "thinking" that 'foo' took a structure by component.
|
|
|
|
|
2003-09-29 21:18:36 +00:00
|
|
|
struct C {
|
2005-04-23 21:26:11 +00:00
|
|
|
int A, B;
|
|
|
|
~C() {}
|
2003-09-29 21:18:36 +00:00
|
|
|
};
|
|
|
|
|
2003-09-29 21:53:04 +00:00
|
|
|
void foo(C b);
|
|
|
|
|
2003-09-29 21:18:36 +00:00
|
|
|
void test(C *P) {
|
2005-04-23 21:26:11 +00:00
|
|
|
foo(*P);
|
2003-09-29 21:18:36 +00:00
|
|
|
}
|
|
|
|
|