xref: /llvm-project/clang/test/Analysis/cstring-syntax-cxx.cpp (revision c6e68daac0fa6e77a89f3ca72f266a528503dd1c)
1 // RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s
2 // expected-no-diagnostics
3 
4 // Ensure we don't crash on C++ declarations with special names.
5 struct X {
6   X(int i): i(i) {}
7   int i;
8 };
9 
10 X operator+(X a, X b) {
11   return X(a.i + b.i);
12 }
13 
14 void test(X a, X b) {
15   X c = a + b;
16 }
17 
18