diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
commit | 3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch) | |
tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/SemaCXX/unreachable-code.cpp | |
parent | a0482fa4e7fa27b01184f938097f0666b78016dd (diff) |
Diffstat (limited to 'test/SemaCXX/unreachable-code.cpp')
-rw-r--r-- | test/SemaCXX/unreachable-code.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/unreachable-code.cpp b/test/SemaCXX/unreachable-code.cpp index 528bba7d5e150..40d0c00b9390f 100644 --- a/test/SemaCXX/unreachable-code.cpp +++ b/test/SemaCXX/unreachable-code.cpp @@ -39,3 +39,20 @@ void test3() { bar(); // expected-warning {{will never be executed}} } } + +// PR 6130 - Don't warn about bogus unreachable code with throw's and +// temporary objects. +class PR6130 { +public: + PR6130(); + ~PR6130(); +}; + +int pr6130(unsigned i) { + switch(i) { + case 0: return 1; + case 1: return 2; + default: + throw PR6130(); // no-warning + } +} |