summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/assign-operator.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-11-07 00:02:45 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-11-07 00:02:45 +0000
commit01cad4c6b03579286dbed8900d9e16ea7eebea8c (patch)
tree3b1e3c2e7adf61059834df333a3e88fc9d498d5d /clang/test/CodeGenCXX/assign-operator.cpp
parent9eb7701dff9df1c7900a14c75eb1fba5cd48ed8a (diff)
downloadbcm5719-llvm-01cad4c6b03579286dbed8900d9e16ea7eebea8c.tar.gz
bcm5719-llvm-01cad4c6b03579286dbed8900d9e16ea7eebea8c.zip
Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators. The mistake messes up IRGen because it ends up assuming that the assignment operator is actually the implicit copy assignment operator, and therefore tries to emit the RHS as an lvalue. llvm-svn: 86307
Diffstat (limited to 'clang/test/CodeGenCXX/assign-operator.cpp')
-rw-r--r--clang/test/CodeGenCXX/assign-operator.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/assign-operator.cpp b/clang/test/CodeGenCXX/assign-operator.cpp
new file mode 100644
index 00000000000..3e0be451943
--- /dev/null
+++ b/clang/test/CodeGenCXX/assign-operator.cpp
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -emit-llvm-only -verify
+
+class x {
+int operator=(int);
+};
+void a() {
+ x a;
+ a = 1u;
+}
OpenPOWER on IntegriCloud