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