diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-11-28 16:40:49 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-11-28 16:40:49 +0000 |
| commit | 66bbf50877faac890d9857e892a6ce02918d5d01 (patch) | |
| tree | c54f58034d89274452fbb6c7d32b77d4ece23831 /clang/test/CodeGenCXX/copy-constructor-elim-2.cpp | |
| parent | 1679580cc94fd814f33efff5d93245769bc992c1 (diff) | |
| download | bcm5719-llvm-66bbf50877faac890d9857e892a6ce02918d5d01.tar.gz bcm5719-llvm-66bbf50877faac890d9857e892a6ce02918d5d01.zip | |
Look through parentheses when deciding whether an expr is a temporary object. Fixes PR8683.
llvm-svn: 120247
Diffstat (limited to 'clang/test/CodeGenCXX/copy-constructor-elim-2.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/copy-constructor-elim-2.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/copy-constructor-elim-2.cpp b/clang/test/CodeGenCXX/copy-constructor-elim-2.cpp index 73e9b94bcd1..563676f6e36 100644 --- a/clang/test/CodeGenCXX/copy-constructor-elim-2.cpp +++ b/clang/test/CodeGenCXX/copy-constructor-elim-2.cpp @@ -31,3 +31,25 @@ namespace no_elide_base { // CHECK: ret void } } + +// PR8683. + +namespace PR8683 { + +struct A { + A(); + A(const A&); + A& operator=(const A&); +}; + +struct B { + A a; +}; + +void f() { + // Verify that we don't mark the copy constructor in this expression as elidable. + // CHECK: call void @_ZN6PR86831AC1ERKS0_ + A a = (B().a); +} + +} |

