diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 2 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/eh.cpp | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index eb471ac173d..d6e498f453c 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -830,7 +830,7 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) { // If we have exactly one branch-after and no branch-throughs, we // can dispatch it without a switch. - if (!Scope.hasBranchThroughs() && + if (!Scope.hasEHBranchThroughs() && Scope.getNumEHBranchAfters() == 1) { assert(!EHBranchThroughDest); diff --git a/clang/test/CodeGenCXX/eh.cpp b/clang/test/CodeGenCXX/eh.cpp index e22063a4c12..3a2a38632f4 100644 --- a/clang/test/CodeGenCXX/eh.cpp +++ b/clang/test/CodeGenCXX/eh.cpp @@ -361,3 +361,21 @@ namespace test13 { } catch (int x) {} } } + +// rdar://problem/8231514 +namespace test14 { + struct A { ~A(); }; + struct B { ~B(); }; + + B b(); + void opaque(); + + void foo() { + A a; + try { + B str = b(); + opaque(); + } catch (int x) { + } + } +} |