This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Make vector::at() assertion message more useful (try #2)


On Wed, Sep 4, 2013 at 9:55 PM, Daniel Krügler
<daniel.kruegler@gmail.com> wrote:

>> Did you mean "pessimises code size", or something else?
>
> Yes.

Daniel's idea proved a good one, and I now have a patch that I am
happy with, and that will be easy to extend to string::at(), and other
__throw_... functions.

I've added the new snprintf.cc to c++11/ rather than c++98/ as Paolo
suggested, because the only current caller is in c++11/functexcept.cc

Thanks,
-- 
Paul Pluzhnikov

libstdc++-v3/ChangeLog:

2013-09-12  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* src/c++11/Makefile.am: Add snprintf.cc
	* src/c++11/Makefile.in: Regenerate.
	* include/bits/functexcept.h (__throw_out_of_range): Adjust.
	* src/c++11/functexcept.cc (__throw_out_of_range): New overload.
	* src/c++11/snprintf.cc: New.
	* config/abi/pre/gnu.ver: Add _ZSt20__throw_out_of_rangePKcz.
	* include/bits/stl_vector.h (_M_range_check): Print
	additional assertion details.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Adjust.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc:
	Likewise.

Attachment: gcc-20130912.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]