summaryrefslogtreecommitdiffstats
path: root/test/Analysis/cxx11-crashes.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/Analysis/cxx11-crashes.cpp
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Analysis/cxx11-crashes.cpp')
-rw-r--r--test/Analysis/cxx11-crashes.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp
new file mode 100644
index 0000000..16bfc89
--- /dev/null
+++ b/test/Analysis/cxx11-crashes.cpp
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s
+
+// radar://11485149, PR12871
+class PlotPoint {
+ bool valid;
+};
+
+PlotPoint limitedFit () {
+ PlotPoint fit0;
+ fit0 = limitedFit ();
+ return fit0;
+}
+
+// radar://11487541, NamespaceAlias
+namespace boost {namespace filesystem3 {
+class path {
+public:
+ path(){}
+};
+
+}}
+namespace boost
+{
+ namespace filesystem
+ {
+ using filesystem3::path;
+ }
+}
+
+void radar11487541() {
+ namespace fs = boost::filesystem;
+ fs::path p;
+}
+
+// PR12873 radar://11499139
+void testFloatInitializer() {
+ const float ysize={0.015}, xsize={0.01};
+}
+
+
+// PR12874, radar://11487525
+template<class T> struct addr_impl_ref {
+ T & v_;
+ inline addr_impl_ref( T & v ): v_( v ) {
+ }
+ inline operator T& () const {return v_;}
+};
+template<class T> struct addressof_impl {
+ static inline T * f( T & v, long ) {
+ return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
+ }
+};
+template<class T> T * addressof( T & v ) {
+ return addressof_impl<T>::f( addr_impl_ref<T>( v ), 0 );
+}
+void testRadar11487525_1(){
+ bool s[25];
+ addressof(s);
+}
+
+// radar://11487525 Don't crash on CK_LValueBitCast.
+bool begin(double *it) {
+ typedef bool type[25];
+ bool *a = reinterpret_cast<type &>(*( reinterpret_cast<char *>( it )));
+ return *a;
+}
OpenPOWER on IntegriCloud