egcs-971016/libstc++/stl/vector patch (revised)

Greg Galloway gregg@eoeml.gtri.gatech.edu
Fri Oct 17 15:05:00 GMT 1997


Fri Oct 17 13:39:07 EDT 1997  Gregory L. Galloway <gregg@eoeml.gtri.gatech.edu>

	* vector.h(allocate_and_fill,allocate_and_copy): Moved return stmt
	outside of exception handling block to suppress warning about return
	without value from non-void function.

*** libstdc++/stl/vector.h.orig	Fri Oct 17 11:55:15 1997
--- libstdc++/stl/vector.h	Fri Oct 17 13:38:48 1997
***************
*** 194,200 ****
        try {
  #         endif /* __STL_USE_EXCEPTIONS */
          uninitialized_fill_n(result, n, x);
-         return result;
  #         ifdef __STL_USE_EXCEPTIONS
        }
        catch(...) {
--- 194,199 ----
***************
*** 202,207 ****
--- 201,207 ----
          throw;
        }
  #         endif /* __STL_USE_EXCEPTIONS */
+       return result;
      }
  
  #ifdef __STL_MEMBER_TEMPLATES
***************
*** 213,219 ****
        try {
  #         endif /* __STL_USE_EXCEPTIONS */
          uninitialized_copy(first, last, result);
-         return result;
  #         ifdef __STL_USE_EXCEPTIONS
        }
        catch(...) {
--- 213,218 ----
***************
*** 221,226 ****
--- 220,226 ----
          throw;
        }
  #         endif /* __STL_USE_EXCEPTIONS */
+       return result;
      }
  #else /* __STL_MEMBER_TEMPLATES */
      iterator allocate_and_copy(size_type n,
***************
*** 230,242 ****
        try {
  #         endif /* __STL_USE_EXCEPTIONS */
          uninitialized_copy(first, last, result);
-         return result;
  #         ifdef __STL_USE_EXCEPTIONS
        }
        catch(...) {
          data_allocator::deallocate(result, n);
          throw;
        }
  #         endif /* __STL_USE_EXCEPTIONS */
      }
  #endif /* __STL_MEMBER_TEMPLATES */
--- 230,242 ----
        try {
  #         endif /* __STL_USE_EXCEPTIONS */
          uninitialized_copy(first, last, result);
  #         ifdef __STL_USE_EXCEPTIONS
        }
        catch(...) {
          data_allocator::deallocate(result, n);
          throw;
        }
  #         endif /* __STL_USE_EXCEPTIONS */
+       return result;
      }
  #endif /* __STL_MEMBER_TEMPLATES */



More information about the Gcc mailing list