llvm-project/clang/test/Analysis/cstring-syntax-cxx.cpp
Anna Zaks 7aba6368fa [analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
declarations with special names.

A patch by Dmitri Gribenko.

llvm-svn: 149525
2012-02-01 19:16:20 +00:00

17 lines
317 B
C++

// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.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;
}