diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
| commit | bca07a4524feb4edec581062d631a13116320a24 (patch) | |
| tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/CodeGenCXX/copy-constructor-elim-2.cpp | |
| parent | 998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/copy-constructor-elim-2.cpp')
| -rw-r--r-- | test/CodeGenCXX/copy-constructor-elim-2.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/CodeGenCXX/copy-constructor-elim-2.cpp b/test/CodeGenCXX/copy-constructor-elim-2.cpp index 73e9b94bcd11..4f4a8e998bee 100644 --- a/test/CodeGenCXX/copy-constructor-elim-2.cpp +++ b/test/CodeGenCXX/copy-constructor-elim-2.cpp @@ -21,7 +21,7 @@ namespace no_elide_base { Derived(const Other &O); }; - // CHECK: define void @_ZN13no_elide_base7DerivedC1ERKNS_5OtherE + // CHECK: define void @_ZN13no_elide_base7DerivedC1ERKNS_5OtherE(%"struct.no_elide_base::Derived"* %this, %"struct.PR8683::A"* %O) unnamed_addr Derived::Derived(const Other &O) // CHECK: call void @_ZNK13no_elide_base5OthercvNS_4BaseEEv // CHECK: call void @_ZN13no_elide_base4BaseC2ERKS0_ @@ -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); +} + +} |
