summaryrefslogtreecommitdiff
path: root/test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
commit486754660bb926339aefcf012a3f848592babb8b (patch)
treeecdbc446c9876f4f120f701c243373cd3cb43db3 /test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h
parent55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff)
Notes
Diffstat (limited to 'test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h')
-rw-r--r--test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h b/test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h
new file mode 100644
index 0000000000000..2397824fc965a
--- /dev/null
+++ b/test/Analysis/Inputs/system-header-simulator-for-cxx-uninitialized-object.h
@@ -0,0 +1,18 @@
+// Like the compiler, the static analyzer treats some functions differently if
+// they come from a system header -- for example, it is assumed that system
+// functions do not arbitrarily free() their parameters, and that some bugs
+// found in system headers cannot be fixed by the user and should be
+// suppressed.
+
+#pragma clang system_header
+
+struct RecordInSystemHeader {
+ int a;
+ int b;
+};
+
+template <class T>
+struct ContainerInSystemHeader {
+ T &t;
+ ContainerInSystemHeader(T& t) : t(t) {}
+};