re PR c++/77748 (pr77550.C fails on arm-none-eabi)

2016-09-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77748
        * g++.dg/pr77550.C: Avoid undefined behavior.

From-SVN: r240573
This commit is contained in:
Bernd Edlinger 2016-09-28 12:11:57 +00:00 committed by Bernd Edlinger
parent 7d290e9393
commit fcf32bad2d
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2016-09-28 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/77748
* g++.dg/pr77550.C: Avoid undefined behavior.
* gcc.dg/tree-ssa/pr68198.c: Fix dg-final.
2016-09-28 Wilco Dijkstra <wdijkstr@arm.com>

View File

@ -1,6 +1,7 @@
// { dg-do run }
// { dg-options "-std=c++14 -O3" }
#define enum enum __attribute((mode(SI)))
namespace std {
typedef int size_t;
inline namespace __cxx11 {}
@ -229,15 +230,17 @@ template <typename, typename, typename> struct basic_string {
struct _Alloc_hider {
_Alloc_hider(pointer, allocator<char> && = allocator<char>());
} _M_dataplus;
size_type _M_string_length;
size_type _M_string_length = 0;
enum { _S_local_capacity = 15 } _M_local_buf[_S_local_capacity];
pointer _M_local_data();
void _M_set_length(size_type);
basic_string() : _M_dataplus(_M_local_data()) { _M_set_length(0); }
basic_string() : _M_dataplus(0) {}
basic_string(const basic_string &) : _M_dataplus(0) {}
size_type size() { return _M_string_length; }
char *data() const {}
};
//template<> basic_string<char, std::char_traits<char>, std::allocator<char>>::
//_Alloc_hider::_Alloc_hider(char*, std::allocator<char>&&) {}
extern "C" void
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_ (...) {}
}
template <typename _CharT>
int operator==(basic_string<_CharT> &p1, const basic_string<_CharT> &p2) {