diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/Analysis/cstring-syntax-cxx.cpp | |
parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) |
Notes
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 000000000000..f8975abc185b --- /dev/null +++ b/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; +} + |