diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-02 18:29:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-02 18:29:00 +0000 |
commit | d1d56df188e25c633f9bc65d229897b42442b0f7 (patch) | |
tree | 6a99b850fabd93d5cfc0dc62fcdee12715fabbcf /test/CodeGenCXX/value-init.cpp | |
parent | 2575585b79d3380ae5175437da160e5b56385fa8 (diff) |
fix PR8726 by teaching the aggregate init optimization code to handle
structs with references in them correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/value-init.cpp')
-rw-r--r-- | test/CodeGenCXX/value-init.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/value-init.cpp b/test/CodeGenCXX/value-init.cpp index c4eb1c8990..48ea3ca9ed 100644 --- a/test/CodeGenCXX/value-init.cpp +++ b/test/CodeGenCXX/value-init.cpp @@ -138,3 +138,16 @@ namespace zeroinit { // CHECK-NEXT: call void @_ZN8zeroinit2X2IiEC2Ev // CHECK-NEXT: ret void } + +namespace PR8726 { +class C; +struct S { + const C &c1; + int i; + const C &c2; +}; +void f(const C& c) { + S s = {c, 42, c}; +} + +}
\ No newline at end of file |