summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/malloc-overflow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/malloc-overflow.cpp')
-rw-r--r--clang/test/Analysis/malloc-overflow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc-overflow.cpp b/clang/test/Analysis/malloc-overflow.cpp
new file mode 100644
index 0000000..c1ac6be
--- /dev/null
+++ b/clang/test/Analysis/malloc-overflow.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.MallocOverflow -verify %s
+
+class A {
+public:
+ A& operator<<(const A &a);
+};
+
+void f() {
+ A a = A(), b = A();
+ a << b;
+}