Fix internal error on canonicalization of clang types.
	* cp-name-parser.y (operator): New comment at make_operator call for
	new, delete, new[] and delete[].
	(exp): Use "sizeof ".  Add new comment at make_operator call.

gdb/testsuite/
	Fix internal error on canonicalization of clang types.
	* gdb.dwarf2/dw2-canonicalize-type.S: New file.
	* gdb.dwarf2/dw2-canonicalize-type.exp: New file.
	* lib/gdb.exp (gdb_file_cmd): Catch also GDB internal error.
This commit is contained in:
Jan Kratochvil
2012-09-21 20:01:12 +00:00
parent 9bf4bce984
commit 04e7407c59
6 changed files with 220 additions and 5 deletions

View File

@@ -446,13 +446,29 @@ demangler_special
;
operator : OPERATOR NEW
{ $$ = make_operator ("new", 3); }
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
$$ = make_operator ("new", 3);
}
| OPERATOR DELETE
{ $$ = make_operator ("delete ", 1); }
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
$$ = make_operator ("delete ", 1);
}
| OPERATOR NEW '[' ']'
{ $$ = make_operator ("new[]", 3); }
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
$$ = make_operator ("new[]", 3);
}
| OPERATOR DELETE '[' ']'
{ $$ = make_operator ("delete[] ", 1); }
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
$$ = make_operator ("delete[] ", 1);
}
| OPERATOR '+'
{ $$ = make_operator ("+", 2); }
| OPERATOR '-'
@@ -1183,7 +1199,11 @@ exp : FLOAT
;
exp : SIZEOF '(' type ')' %prec UNARY
{ $$ = d_unary ("sizeof", $3); }
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
$$ = d_unary ("sizeof ", $3);
}
;
/* C++. */