summaryrefslogtreecommitdiff
path: root/patches/gcc/4.0.0/150-pr21951.patch
blob: 8c5ffb9d89b18d9e79e098a5787186c0aff4923a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Workaround for buglet in std::vector etc. when compiling 
with gcc-4.0.0 -Wall -O -fno-exceptions
Fixes:

.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp,
_Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator<int>]':
.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of
non-void function 'typename _Alloc::pointer std::vector<_Tp,
_Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with
_ForwardIterator = int*, _Tp = int, _Alloc = std::allocator<int>]' being inlined

See http://gcc.gnu.org/PR21951

--- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h.old	2005-06-11 03:58:20.000000000 -0700
+++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h	2005-06-11 04:01:21.000000000 -0700
@@ -765,13 +765,13 @@
 	    {
 	      std::__uninitialized_copy_a(__first, __last, __result,
 					  this->get_allocator());
-	      return __result;
 	    }
 	  catch(...)
 	    {
 	      _M_deallocate(__result, __n);
 	      __throw_exception_again;
 	    }
+	  return __result;
 	}
 
 
--- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h.old	2005-06-11 03:58:20.000000000 -0700
+++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h	2005-06-11 04:05:18.990003248 -0700
@@ -84,13 +84,13 @@
 	{
 	  for (; __first != __last; ++__first, ++__cur)
 	    std::_Construct(&*__cur, *__first);
-	  return __cur;
 	}
       catch(...)
 	{
 	  std::_Destroy(__result, __cur);
 	  __throw_exception_again;
 	}
+      return __cur;
     }
 
   /**
@@ -236,13 +236,13 @@
 	{
 	  for (; __first != __last; ++__first, ++__cur)
 	    __alloc.construct(&*__cur, *__first);
-	  return __cur;
 	}
       catch(...)
 	{
 	  std::_Destroy(__result, __cur, __alloc);
 	  __throw_exception_again;
 	}
+      return __cur;
     }
 
   template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
@@ -337,11 +337,13 @@
 	{
 	  return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
 	}
+#ifdef __EXCEPTIONS  // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
       catch(...)
 	{
 	  std::_Destroy(__result, __mid, __alloc);
 	  __throw_exception_again;
 	}
+#endif
     }
 
   // __uninitialized_fill_copy
@@ -360,11 +362,13 @@
 	{
 	  return std::__uninitialized_copy_a(__first, __last, __mid, __alloc);
 	}
+#ifdef __EXCEPTIONS  // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
       catch(...)
 	{
 	  std::_Destroy(__result, __mid, __alloc);
 	  __throw_exception_again;
 	}
+#endif
     }
 
   // __uninitialized_copy_fill
--- gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope.old	2005-06-11 03:58:20.000000000 -0700
+++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope	2005-06-11 04:13:26.628870872 -0700
@@ -1645,11 +1645,13 @@
 	_S_cond_store_eos(__buf[__size]);
 	try
 	  { return _S_new_RopeLeaf(__buf, __size, __a); }
+#ifdef __EXCEPTIONS  // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
 	catch(...)
 	  {
 	    _RopeRep::__STL_FREE_STRING(__buf, __size, __a);
 	    __throw_exception_again;
 	  }
+#endif
       }
 
       // Concatenation of nonempty strings.
--- gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory.old	2005-06-11 03:58:20.000000000 -0700
+++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory	2005-06-11 04:13:52.897877376 -0700
@@ -85,11 +85,13 @@
 	    std::_Construct(&*__cur, *__first);
 	  return pair<_InputIter, _ForwardIter>(__first, __cur);
 	}
+#ifdef __EXCEPTIONS  // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
       catch(...)
 	{
 	  std::_Destroy(__result, __cur);
 	  __throw_exception_again;
 	}
+#endif
     }
 
   template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
@@ -144,11 +146,13 @@
 	    __alloc.construct(&*__cur, *__first);
 	  return pair<_InputIter, _ForwardIter>(__first, __cur);
 	}
+#ifdef __EXCEPTIONS  // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
       catch(...)
 	{
 	  std::_Destroy(__result, __cur, __alloc);
 	  __throw_exception_again;
 	}
+#endif
     }
 
   template<typename _InputIter, typename _Size, typename _ForwardIter,
--- gcc-4.0.1-20050607/libstdc++-v3/include/ext/hashtable.h.old	2005-06-11 03:58:20.000000000 -0700
+++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/hashtable.h	2005-06-11 04:14:28.384482592 -0700
@@ -607,13 +607,13 @@
 	try
 	  {
 	    this->get_allocator().construct(&__n->_M_val, __obj);
-	    return __n;
 	  }
 	catch(...)
 	  {
 	    _M_put_node(__n);
 	    __throw_exception_again;
 	  }
+	return __n;
       }
 
       void