aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-09-28 12:11:57 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-09-28 12:11:57 +0000
commitfcf32bad2d611add21e748b4fd93d7cf63660a43 (patch)
tree445a2d558d6f2e7556efe65aac05100ca958f92e /gcc
parent7d290e93939986665ef12ed083e0e8abb85b37eb (diff)
downloadgcc-fcf32bad2d611add21e748b4fd93d7cf63660a43.zip
gcc-fcf32bad2d611add21e748b4fd93d7cf63660a43.tar.gz
gcc-fcf32bad2d611add21e748b4fd93d7cf63660a43.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/pr77550.C11
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index aa03b6d..b942bd6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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>
diff --git a/gcc/testsuite/g++.dg/pr77550.C b/gcc/testsuite/g++.dg/pr77550.C
index 4035674..a106473 100644
--- a/gcc/testsuite/g++.dg/pr77550.C
+++ b/gcc/testsuite/g++.dg/pr77550.C
@@ -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) {