diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-23 05:26:38 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-23 05:26:38 +0000 |
| commit | 6565e92f3f94cfa7d2c1d5127411c23e9bd27192 (patch) | |
| tree | 69458b7eee06b02a69a9c51b18aeedeee50580bd /clang/test/CodeGenCXX/ctor-dtor-alias.cpp | |
| parent | 5fa925ebf646263593c28be1b780935e11d5f732 (diff) | |
| download | bcm5719-llvm-6565e92f3f94cfa7d2c1d5127411c23e9bd27192.tar.gz bcm5719-llvm-6565e92f3f94cfa7d2c1d5127411c23e9bd27192.zip | |
[pr22293] Don't crash during codegen of a recursive destructor.
In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.
If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.
llvm-svn: 226896
Diffstat (limited to 'clang/test/CodeGenCXX/ctor-dtor-alias.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/ctor-dtor-alias.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/ctor-dtor-alias.cpp b/clang/test/CodeGenCXX/ctor-dtor-alias.cpp index 6f8aedc0712..4c119718afb 100644 --- a/clang/test/CodeGenCXX/ctor-dtor-alias.cpp +++ b/clang/test/CodeGenCXX/ctor-dtor-alias.cpp @@ -235,3 +235,14 @@ foo::~foo() {} // CHECK6: @_ZN6test113fooD2Ev = alias {{.*}} @_ZN6test113barD2Ev // CHECK6: @_ZN6test113fooD1Ev = alias {{.*}} @_ZN6test113fooD2Ev } + +namespace test12 { +template <int> +struct foo { + ~foo() { delete this; } +}; + +template class foo<1>; +// CHECK6: @_ZN6test123fooILi1EED1Ev = weak_odr alias {{.*}} @_ZN6test123fooILi1EED2Ev +// CHECK6: define weak_odr void @_ZN6test123fooILi1EED2Ev({{.*}}) {{.*}} comdat($_ZN6test123fooILi1EED5Ev) +} |

