diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-28 22:33:28 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-28 22:33:28 +0000 |
commit | 8606d75265e4f162bcd81f08a5b59eec6ccc0ac6 (patch) | |
tree | f6b612698392e78146e05ce319b2a60262ba091e /clang/test/CodeGenCXX/exception-spec-decay.cpp | |
parent | 836a93bdb3bbf6b2b63a72c04ae307b7ed4e578a (diff) | |
download | bcm5719-llvm-8606d75265e4f162bcd81f08a5b59eec6ccc0ac6.tar.gz bcm5719-llvm-8606d75265e4f162bcd81f08a5b59eec6ccc0ac6.zip |
PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and
additional testcases by me.
llvm-svn: 168822
Diffstat (limited to 'clang/test/CodeGenCXX/exception-spec-decay.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/exception-spec-decay.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/exception-spec-decay.cpp b/clang/test/CodeGenCXX/exception-spec-decay.cpp new file mode 100644 index 00000000000..49283539070 --- /dev/null +++ b/clang/test/CodeGenCXX/exception-spec-decay.cpp @@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions %s -triple=i686-unknown-linux -emit-llvm -o - | FileCheck %s +typedef int Array[10]; + +void foo() throw (Array) { + throw 0; + // CHECK: landingpad + // CHECK-NEXT: filter {{.*}} @_ZTIPi +} + +struct S { + void foo() throw (S[10]) { + throw 0; + } +}; + +template <typename T> +struct S2 { + void foo() throw (T) { + throw 0; + } +}; + +int main() { + S s; + s.foo(); + // CHECK: landingpad + // CHECK-NEXT: filter {{.*}} @_ZTIP1S + + S2 <int[10]> s2; + s2.foo(); + // CHECK: landingpad + // CHECK-NEXT: filter {{.*}} @_ZTIPi +} |