diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C b/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C new file mode 100644 index 000000000..064678d37 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C @@ -0,0 +1,24 @@ +// 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 > {};}} |