summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/cstring-syntax-cxx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/cstring-syntax-cxx.cpp')
-rw-r--r--clang/test/Analysis/cstring-syntax-cxx.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/cstring-syntax-cxx.cpp b/clang/test/Analysis/cstring-syntax-cxx.cpp
new file mode 100644
index 0000000..f8975ab
--- /dev/null
+++ b/clang/test/Analysis/cstring-syntax-cxx.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s
+
+// Ensure we don't crash on C++ declarations with special names.
+struct X {
+ X(int i): i(i) {}
+ int i;
+};
+
+X operator+(X a, X b) {
+ return X(a.i + b.i);
+}
+
+void test(X a, X b) {
+ X c = a + b;
+}
+