summaryrefslogtreecommitdiff
path: root/bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp
diff options
context:
space:
mode:
authorChristian Poveda Ruiz <31802960+pvdrz@users.noreply.github.com>2022-11-22 11:41:32 -0500
committerGitHub <noreply@github.com>2022-11-22 11:41:32 -0500
commit046d6f9eea1803253c06dd99a0d38f5dcb5ed9c1 (patch)
tree286eeb0d0a9b7c7f2b756e96b01a21253158dc64 /bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp
parentf160d11d56007fe1b1125d04f0cb31af0b18fc6e (diff)
Add `--wrap-unsafe-ops` option (#2354)
This reverts commit e8ffb42ab66405ac56d04494a30e54b584f2d4dd and adds a new `--wrap-unsafe-ops` option as a workaround.
Diffstat (limited to 'bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp')
-rw-r--r--bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp b/bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp
new file mode 100644
index 00000000..e3d11c57
--- /dev/null
+++ b/bindgen-tests/tests/headers/wrap_unsafe_ops_class.hpp
@@ -0,0 +1,74 @@
+// bindgen-flags: --wrap-unsafe-ops --no-layout-tests
+
+class C {
+ int a;
+ // More than rust limits (32)
+ char big_array[33];
+};
+
+class C_with_zero_length_array {
+ int a;
+ // More than rust limits (32)
+ char big_array[33];
+ char zero_length_array[0];
+};
+
+class C_with_zero_length_array_2 {
+ int a;
+ char zero_length_array[0];
+};
+
+class C_with_incomplete_array {
+ int a;
+ // More than rust limits (32)
+ char big_array[33];
+ char incomplete_array[];
+};
+
+class C_with_incomplete_array_2 {
+ int a;
+ char incomplete_array[];
+};
+
+class C_with_zero_length_array_and_incomplete_array {
+ int a;
+ // More than rust limits (32)
+ char big_array[33];
+ char zero_length_array[0];
+ char incomplete_array[];
+};
+
+class C_with_zero_length_array_and_incomplete_array_2 {
+ int a;
+ char zero_length_array[0];
+ char incomplete_array[];
+};
+
+class WithDtor {
+ int b;
+
+ ~WithDtor() {}
+};
+
+class IncompleteArrayNonCopiable {
+ void* whatever;
+ C incomplete_array[];
+};
+
+union Union {
+ float d;
+ int i;
+};
+
+class WithUnion {
+ Union data;
+};
+
+class RealAbstractionWithTonsOfMethods {
+ void foo();
+public:
+ void bar() const;
+ void bar();
+ void bar(int foo);
+ static void sta();
+};