summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-24 23:14:04 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-24 23:14:04 +0000
commit02dde146e09deb425b96f8308d5ec428f352501c (patch)
tree4a3b486244e152dded1dc5c05ae517df832779a7 /clang/test/CodeGenCXX
parentaf2684154fc66d6295635b33b26074c2c3262c5e (diff)
downloadbcm5719-llvm-02dde146e09deb425b96f8308d5ec428f352501c.tar.gz
bcm5719-llvm-02dde146e09deb425b96f8308d5ec428f352501c.zip
When returning from a function that has a reference return type, use
EmitReferenceBindingToExpr() rather than assuming we have an lvalue. This is just the lowest hanging fruit for PR6024, which still requires a bit of work. llvm-svn: 99447
Diffstat (limited to 'clang/test/CodeGenCXX')
-rw-r--r--clang/test/CodeGenCXX/references.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/references.cpp b/clang/test/CodeGenCXX/references.cpp
index 39b5909fb9a..a15d4069c20 100644
--- a/clang/test/CodeGenCXX/references.cpp
+++ b/clang/test/CodeGenCXX/references.cpp
@@ -147,3 +147,10 @@ void f(int &a) {
struct s0;
struct s1 { struct s0 &s0; };
void f0(s1 a) { s1 b = a; }
+
+// PR6024
+// CHECK: @_Z2f2v()
+// CHECK: alloca
+// CHECK: store
+// CHECK: load
+const int &f2() { return 0; }
OpenPOWER on IntegriCloud