[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Avoid name clash in C++ ctors
From: |
Akim Demaille |
Subject: |
FYI: Avoid name clash in C++ ctors |
Date: |
Mon, 27 Sep 2004 09:45:08 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* data/lalr1.cc (b4_parse_param_decl_1): New.
(b4_parse_param_decl): Use it to have different names bw attribute
and argument names.
(b4_cc_constructor_call): Likewise.
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.57
diff -u -u -r1.57 lalr1.cc
--- data/lalr1.cc 20 Sep 2004 15:25:25 -0000 1.57
+++ data/lalr1.cc 27 Sep 2004 07:44:52 -0000
@@ -83,13 +83,22 @@
# b4_parse_param_decl
# -------------------
-# Constructor's extra arguments.
+# Extra formal arguments of the constructor.
+# Change the parameter names from "foo" into "foo_yyarg", so that
+# there is no collision bw the user chosen attribute name, and the
+# argument name in the constructor.
m4_define([b4_parse_param_decl],
- [m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])])
+[m4_ifset([b4_parse_param],
+ [, m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
+
+m4_define([b4_parse_param_decl_1],
+[$1_yyarg])
+
+
# b4_parse_param_cons
# -------------------
-# constructor's extra initialisations.
+# Extra initialisations of the constructor.
m4_define([b4_parse_param_cons],
[m4_ifset([b4_parse_param],
[,
@@ -98,11 +107,11 @@
[m4_map_sep([b4_cc_constructor_call], [,
], address@hidden)])
m4_define([b4_cc_constructor_call],
- [$2($2)])
+ [$2 ($2_yyarg)])
# b4_parse_param_vars
# -------------------
-# Extra instance variables.
+# Extra instance variables.
m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param],
[
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Avoid name clash in C++ ctors,
Akim Demaille <=