merge from gcc

This commit is contained in:
DJ Delorie 2003-03-11 20:18:26 +00:00
parent 48fe7bdacc
commit d8cbbf95b2
2 changed files with 32 additions and 23 deletions

View file

@ -1,3 +1,9 @@
2003-03-11 Carlo Wood <carlo@gnu.org>
* cplus-dem.c (demangle_integral_value): Correction to reflect
patch of 2002-01-10 in order to also make negative multi-digits
without leading underscore work.
2003-03-03 Mark Mitchell <mark@codesourcery.com> 2003-03-03 Mark Mitchell <mark@codesourcery.com>
* cplus-dem.c: Add license exception to copyright notice. * cplus-dem.c: Add license exception to copyright notice.

View file

@ -1797,31 +1797,34 @@ demangle_integral_value (work, mangled, s)
success = 0; success = 0;
/* Negative numbers are indicated with a leading `m'. */ if (**mangled == '_')
if (**mangled == 'm') {
{ if (mangled[0][1] == 'm')
string_appendn (s, "-", 1); {
(*mangled)++; /* Since consume_count_with_underscores does not handle the
} `m'-prefix we must do it here, using consume_count and
else if (mangled[0][0] == '_' && mangled[0][1] == 'm') adjusting underscores: we have to consume the underscore
{ matching the prepended one. */
/* Since consume_count_with_underscores does not handle the multidigit_without_leading_underscore = 1;
`m'-prefix we must do it here, using consume_count and string_appendn (s, "-", 1);
adjusting underscores: we have to consume the underscore (*mangled) += 2;
matching the prepended one. */ }
multidigit_without_leading_underscore = 1; else
string_appendn (s, "-", 1); {
(*mangled) += 2; /* Do not consume a following underscore;
} consume_count_with_underscores will consume what
else if (**mangled == '_') should be consumed. */
{ leave_following_underscore = 1;
/* Do not consume a following underscore; }
multidigit_without_leading_underscore will consume what should be
consumed. */
leave_following_underscore = 1;
} }
else else
{ {
/* Negative numbers are indicated with a leading `m'. */
if (**mangled == 'm')
{
string_appendn (s, "-", 1);
(*mangled)++;
}
/* Since consume_count_with_underscores does not handle /* Since consume_count_with_underscores does not handle
multi-digit numbers that do not start with an underscore, multi-digit numbers that do not start with an underscore,
and this number can be an integer template parameter, and this number can be an integer template parameter,
@ -1862,7 +1865,7 @@ demangle_integral_value (work, mangled, s)
/* All is well. */ /* All is well. */
success = 1; success = 1;
} }
} }
return success; return success;
} }