diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/Analysis/misc-ps-region-store.cpp | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'test/Analysis/misc-ps-region-store.cpp')
-rw-r--r-- | test/Analysis/misc-ps-region-store.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp index bfa5e5c..1dba09d 100644 --- a/test/Analysis/misc-ps-region-store.cpp +++ b/test/Analysis/misc-ps-region-store.cpp @@ -159,3 +159,84 @@ int r8375510(R8375510 x, R8375510 y) { for (; ; x++) { } } +// PR8419 -- this used to crash. + +class String8419 { + public: + char& get(int n); + char& operator[](int n); +}; + +char& get8419(); + +void Test8419() { + String8419 s; + ++(s.get(0)); + get8419()--; // used to crash + --s[0]; // used to crash + s[0] &= 1; // used to crash + s[0]++; // used to crash +} + +// PR8426 -- this used to crash. + +void Use(void* to); + +template <class T> class Foo { + ~Foo(); + struct Bar; + Bar* bar_; +}; + +template <class T> Foo<T>::~Foo() { + Use(bar_); + T::DoSomething(); + bar_->Work(); +} + +// PR8427 -- this used to crash. + +class Dummy {}; + +bool operator==(Dummy, int); + +template <typename T> +class Foo2 { + bool Bar(); +}; + +template <typename T> +bool Foo2<T>::Bar() { + return 0 == T(); +} + +// PR8433 -- this used to crash. + +template <typename T> +class Foo3 { + public: + void Bar(); + void Baz(); + T value_; +}; + +template <typename T> +void Foo3<T>::Bar() { + Baz(); + value_(); +} + +//===---------------------------------------------------------------------===// +// Handle misc. C++ constructs. +//===---------------------------------------------------------------------===// + +namespace fum { + int i = 3; +}; + +void test_namespace() { + // Previously triggered a crash. + using namespace fum; + int x = i; +} + |