aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-22 16:07:13 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-22 16:07:13 +0000
commit44742d57fbfe7f4041e72db9527e72f63abdbc5e (patch)
tree33dcaefd563d21a3c2711292a03f558159c99bcc /gdb
parentc9b3544acea166649878ad4a7afc502cf44a2c5a (diff)
downloadgdb-44742d57fbfe7f4041e72db9527e72f63abdbc5e.zip
gdb-44742d57fbfe7f4041e72db9527e72f63abdbc5e.tar.gz
gdb-44742d57fbfe7f4041e72db9527e72f63abdbc5e.tar.bz2
* cp-name-parser.y (exp1): Add & ( var ) as a reference expression.
(exp): Remove and document function-like casts.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/cp-name-parser.y21
2 files changed, 14 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c66a8c7..9ee7a1b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2007-10-22 Daniel Jacobowitz <dan@codesourcery.com>
+ * cp-name-parser.y (exp1): Add & ( var ) as a reference expression.
+ (exp): Remove and document function-like casts.
+
+2007-10-22 Daniel Jacobowitz <dan@codesourcery.com>
+
* cp-support.c: Include "safe-ctype.h".
(cp_already_canonical): New function.
(cp_canonicalize_string): Use it. Return NULL for already canonical
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index 0eab4f2..b4597ec 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -1011,6 +1011,8 @@ exp1 : exp '>' exp
in parentheses. */
exp1 : '&' start
{ $$ = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), $2); }
+ | '&' '(' start ')'
+ { $$ = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), $3); }
;
/* Expressions, not including the comma operator. */
@@ -1066,18 +1068,13 @@ exp : REINTERPRET_CAST '<' type '>' '(' exp1 ')' %prec UNARY
}
;
-/* Another form of C++-style cast. "type ( exp1 )" is not allowed (it's too
- ambiguous), but "name ( exp1 )" is. Because we don't need to support
- function types, we can handle this unambiguously (the use of typespec_2
- prevents a silly, harmless conflict with qualifiers_opt). This does not
- appear in demangler output so it's not a great loss if we need to
- disable it. */
-exp : typespec_2 '(' exp1 ')' %prec UNARY
- { $$ = fill_comp (DEMANGLE_COMPONENT_UNARY,
- fill_comp (DEMANGLE_COMPONENT_CAST, $1, NULL),
- $3);
- }
- ;
+/* Another form of C++-style cast is "type ( exp1 )". This creates too many
+ conflicts to support. For a while we supported the simpler
+ "typespec_2 ( exp1 )", but that conflicts with "& ( start )" as a
+ reference, deep within the wilderness of abstract declarators:
+ Qux<int(&(*))> vs Qux<int(&(var))>, a shift-reduce conflict at the
+ innermost left parenthesis. So we do not support function-like casts.
+ Fortunately they never appear in demangler output. */
/* TO INVESTIGATE: ._0 style anonymous names; anonymous namespaces */