[llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Sep 29 16:54:02 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail:
2003-09-29-ArgumentNumberMismatch.cpp updated: 1.1 -> 1.2
---
Log message:
Simplify test, include problem analysis
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp
diff -u llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.1 llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.2
--- llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.1 Mon Sep 29 16:18:36 2003
+++ llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp Mon Sep 29 16:53:04 2003
@@ -1,11 +1,15 @@
+// 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.
+
struct C {
int A, B;
~C() {}
-
- void operator^(C b) const { }
};
+void foo(C b);
+
void test(C *P) {
- *P ^ *P;
+ foo(*P);
}
More information about the llvm-commits
mailing list