summaryrefslogtreecommitdiff
path: root/trunk/test/catch_member_data_pointer_01.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/test/catch_member_data_pointer_01.cpp')
-rw-r--r--trunk/test/catch_member_data_pointer_01.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/trunk/test/catch_member_data_pointer_01.cpp b/trunk/test/catch_member_data_pointer_01.cpp
new file mode 100644
index 0000000..44ff753
--- /dev/null
+++ b/trunk/test/catch_member_data_pointer_01.cpp
@@ -0,0 +1,57 @@
+//===----------------- catch_member_data_pointer_01.cpp -------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <cassert>
+
+struct A
+{
+ const int i;
+ int j;
+};
+
+typedef const int A::*md1;
+typedef int A::*md2;
+
+void test1()
+{
+ try
+ {
+ throw &A::i;
+ assert(false);
+ }
+ catch (md2)
+ {
+ assert(false);
+ }
+ catch (md1)
+ {
+ }
+}
+
+void test2()
+{
+ try
+ {
+ throw &A::j;
+ assert(false);
+ }
+ catch (md1)
+ {
+ assert(false);
+ }
+ catch (md2)
+ {
+ }
+}
+
+int main()
+{
+ test1();
+ test2();
+}