summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-07 08:34:34 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-07 08:34:34 +0000
commite82b6171dd6e772c84dc2354a25c2b55d2f22856 (patch)
treebef4420b975640f563780401dc3cc768ec639a60
parenta110c2830a5829ccaa68a2b70e59dab2e7a2ffac (diff)
downloadppe42-gcc-e82b6171dd6e772c84dc2354a25c2b55d2f22856.tar.gz
ppe42-gcc-e82b6171dd6e772c84dc2354a25c2b55d2f22856.zip
* cpphash.c (collect_expansion): Also catch ## at start of macro.
* varasm.c (make_decl_rtl): Don't add a number to members of local classes. (make_function_rtl): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32378 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/cpphash.c2
-rw-r--r--gcc/varasm.c11
3 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 57b863ae490..cce837fb81e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2000-03-06 Jason Merrill <jason@casey.cygnus.com>
+
+ * cpphash.c (collect_expansion): Also catch ## at start of macro.
+
+ * varasm.c (make_decl_rtl): Don't add a number to members of
+ local classes.
+ (make_function_rtl): Likewise.
+
2000-03-06 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* gcse.c (compute_can_copy): Adjust if/else blocks from rth's
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index bb772eb72c9..bcb55389e3e 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -346,6 +346,8 @@ collect_expansion (pfile, arglist)
else if (last_token == PASTE)
/* ## ## - the second ## is ordinary. */
goto norm;
+ else if (last_token == START)
+ cpp_error (pfile, "`##' at start of macro definition");
/* Discard the token and any hspace before it. */
while (is_hspace (pfile->token_buffer[here-1]))
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 751ce82b77c..baf06e0548e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -522,8 +522,10 @@ make_function_rtl (decl)
char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *new_name = name;
- /* Rename a nested function to avoid conflicts. */
+ /* Rename a nested function to avoid conflicts, unless it's a member of
+ a local class, in which case the class name is already unique. */
if (decl_function_context (decl) != 0
+ && ! TYPE_P (DECL_CONTEXT (decl))
&& DECL_INITIAL (decl) != 0
&& DECL_RTL (decl) == 0)
{
@@ -765,9 +767,12 @@ make_decl_rtl (decl, asmspec, top_level)
if (DECL_RTL (decl) == 0)
{
/* Can't use just the variable's own name for a variable
- whose scope is less than the whole file.
+ whose scope is less than the whole file, unless it's a member
+ of a local class (which will already be unambiguous).
Concatenate a distinguishing number. */
- if (!top_level && !TREE_PUBLIC (decl) && asmspec == 0)
+ if (!top_level && !TREE_PUBLIC (decl)
+ && ! TYPE_P (DECL_CONTEXT (decl))
+ && asmspec == 0)
{
char *label;
OpenPOWER on IntegriCloud