diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-05-15 22:25:24 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-05-15 22:25:24 +0000 |
commit | 0f136367bcba1783495ad7edaa81bd61fd284ac6 (patch) | |
tree | 5d4aa91441f881772ffaeff2a995dc4c43cd5b00 /libstdc++-v3/src | |
parent | a243fb4a5bb588bbb4b7292a410b9594d7bf6e8d (diff) | |
download | gcc-0f136367bcba1783495ad7edaa81bd61fd284ac6.zip gcc-0f136367bcba1783495ad7edaa81bd61fd284ac6.tar.gz gcc-0f136367bcba1783495ad7edaa81bd61fd284ac6.tar.bz2 |
re PR libstdc++/40160 (-fno-rtti vs _GLIBCXX_DEBUG)
2009-05-15 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40160
* include/debug/formatter.h (_Parameter::_Parameter): Don't use
typeid when __GXX_RTTI is undefined.
* src/debug.cc (_Error_formatter::_Parameter::_M_print_field): Adjust
for null _M_variant._M_iterator._M_type,
_M_variant._M_iterator._M_seq_type, _M_variant._M_sequence._M_type.
* testsuite/21_strings/basic_string/40160.cc: New.
From-SVN: r147599
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/debug.cc | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc index 6ce2e10..bb0aebe 100644 --- a/libstdc++-v3/src/debug.cc +++ b/libstdc++-v3/src/debug.cc @@ -1,6 +1,6 @@ // Debugging mode support code -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -298,9 +298,12 @@ namespace __gnu_debug } else if (strcmp(__name, "type") == 0) { - assert(_M_variant._M_iterator._M_type); - // TBD: demangle! - __formatter->_M_print_word(_M_variant._M_iterator._M_type->name()); + if (!_M_variant._M_iterator._M_type) + __formatter->_M_print_word("<unknown type>"); + else + // TBD: demangle! + __formatter->_M_print_word(_M_variant._M_iterator. + _M_type->name()); } else if (strcmp(__name, "constness") == 0) { @@ -310,7 +313,9 @@ namespace __gnu_debug "constant", "mutable" }; - __formatter->_M_print_word(__constness_names[_M_variant._M_iterator._M_constness]); + __formatter->_M_print_word(__constness_names[_M_variant. + _M_iterator. + _M_constness]); } else if (strcmp(__name, "state") == 0) { @@ -322,7 +327,8 @@ namespace __gnu_debug "dereferenceable", "past-the-end" }; - __formatter->_M_print_word(__state_names[_M_variant._M_iterator._M_state]); + __formatter->_M_print_word(__state_names[_M_variant. + _M_iterator._M_state]); } else if (strcmp(__name, "sequence") == 0) { @@ -333,9 +339,12 @@ namespace __gnu_debug } else if (strcmp(__name, "seq_type") == 0) { - // TBD: demangle! - assert(_M_variant._M_iterator._M_seq_type); - __formatter->_M_print_word(_M_variant._M_iterator._M_seq_type->name()); + if (!_M_variant._M_iterator._M_seq_type) + __formatter->_M_print_word("<unknown seq_type>"); + else + // TBD: demangle! + __formatter->_M_print_word(_M_variant._M_iterator. + _M_seq_type->name()); } else assert(false); @@ -356,9 +365,12 @@ namespace __gnu_debug } else if (strcmp(__name, "type") == 0) { - // TBD: demangle! - assert(_M_variant._M_sequence._M_type); - __formatter->_M_print_word(_M_variant._M_sequence._M_type->name()); + if (!_M_variant._M_sequence._M_type) + __formatter->_M_print_word("<unknown type>"); + else + // TBD: demangle! + __formatter->_M_print_word(_M_variant._M_sequence. + _M_type->name()); } else assert(false); |