diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-01 19:16:20 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-01 19:16:20 +0000 |
commit | 84aac9acc7a73360a7553c46f8da72773adbdd17 (patch) | |
tree | 742c4747d18c1a3a96248e56ee033adb676b2229 /test/Analysis/cstring-syntax-cxx.cpp | |
parent | c36bedc90c687caa71748480c60707ea4608b092 (diff) |
[analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
declarations with special names.
A patch by Dmitri Gribenko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/cstring-syntax-cxx.cpp')
-rw-r--r-- | test/Analysis/cstring-syntax-cxx.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/cstring-syntax-cxx.cpp b/test/Analysis/cstring-syntax-cxx.cpp new file mode 100644 index 0000000000..af8b4d7824 --- /dev/null +++ b/test/Analysis/cstring-syntax-cxx.cpp @@ -0,0 +1,16 @@ +// 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; +} + |