diff options
author | John McCall <rjmccall@apple.com> | 2010-05-03 21:39:56 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-03 21:39:56 +0000 |
commit | e65ce966b6865b686b0a9ba4fc72dfadf3e83701 (patch) | |
tree | 73a08eca146d45e846c98a8a311d18d68f2c5208 /test/CodeGenCXX/static-init.cpp | |
parent | a36f3ed3f19ebd78432d967325e9157ec02e1bdf (diff) |
Just bail out immediately when emitting an unreachable function-local static
variable. Surprisingly, this does seem to be the right way to solve this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102961 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | test/CodeGenCXX/static-init.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index a67d137d6a..750da02603 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -34,3 +34,14 @@ inline void h2() { void h3() { h2(); } + +// PR6980: this shouldn't crash +namespace test0 { + struct A { A(); }; + __attribute__((noreturn)) int throw_exception(); + + void test() { + throw_exception(); + static A r; + } +} |