+2014-05-21 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/61272
+ * ubsan.c (is_ubsan_builtin_p): Turn assert into a condition.
+
2014-05-21 Martin Jambor <mjambor@suse.cz>
* doc/invoke.texi (Optimize Options): Document parameters
+2014-05-21 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/61272
+ * g++.dg/ubsan/pr61272.C: New test.
+
2014-05-21 Cesar Philippidis <cesar@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>
--- /dev/null
+// PR sanitizer/61272
+// { dg-do compile }
+// { dg-options "-fsanitize=undefined -std=c++11" }
+
+namespace std
+{
+ template < typename _Tp > class allocator;
+ template < typename _Alloc > struct allocator_traits {
+ private:
+ template < typename _Tp > auto construct ( _Alloc & __a, _Tp * __p)-> // { dg-error "is private" }
+ decltype (_S_construct (__a, __p)) { }
+ };
+ namespace __gnu_cxx
+ {
+ template < typename _Alloc > struct __alloc_traits:std::allocator_traits < _Alloc > // { dg-error "within this context" }
+ {
+ typedef std::allocator_traits < _Alloc > _Base_type;
+ using _Base_type::construct;
+ };
+ template < typename _Tp, typename _Alloc > struct _Vector_base { typedef typename __gnu_cxx::__alloc_traits < _Alloc >::template rebind < _Tp >::other _Tp_alloc_type; }; // { dg-error "no class template" }
+ template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector : protected _Vector_base < _Tp, _Alloc > { };
+ template < typename NumberT > struct Point2d { };
+ typedef Point2d < int >GdsPoint;
+ class GdsPointList : public vector < GdsPoint > {};}}
bool
is_ubsan_builtin_p (tree t)
{
- gcc_checking_assert (TREE_CODE (t) == FUNCTION_DECL);
- return strncmp (IDENTIFIER_POINTER (DECL_NAME (t)),
- "__builtin___ubsan_", 18) == 0;
+ return TREE_CODE (t) == FUNCTION_DECL
+ && strncmp (IDENTIFIER_POINTER (DECL_NAME (t)),
+ "__builtin___ubsan_", 18) == 0;
}
/* Expand UBSAN_NULL internal call. */