]> Cypherpunks repositories - gostls13.git/commitdiff
catch export on func.
authorRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 00:43:51 +0000 (16:43 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 00:43:51 +0000 (16:43 -0800)
print names in message.

R=ken
OCL=22891
CL=22891

src/cmd/gc/export.c
src/cmd/gc/go.y

index 2b3a6f701f7d6913f862eb10c18da6626d98547d..13a481cab94a1043430214d234106f4a0e09812e 100644 (file)
@@ -73,12 +73,14 @@ autoexport(Sym *s)
                return;
        if(exportname(s->name)) {
                if(dcladj != exportsym)
-                       warn("uppercase missing export");
+                       warn("uppercase missing export: %S", s);
                exportsym(s);
        } else {
-               if(dcladj == exportsym)
-                       warn("export missing uppercase");
-               packagesym(s);
+               if(dcladj == exportsym) {
+                       warn("export missing uppercase: %S", s);
+                       exportsym(s);
+               } else
+                       packagesym(s);
        }
 }
 
index 1dd55523c06e660bab1b5f789276e4906a205d23..a6ea498d425194839d55dbe277c71cb33438acc8 100644 (file)
@@ -186,6 +186,8 @@ xdcl:
        }
 |      xfndcl
        {
+               if($1 != N && $1->nname != N && $1->type->thistuple == 0)
+                       autoexport($1->nname->sym);
                $$ = N;
        }
 |      LEXPORT { dcladj = exportsym; stksize = initstksize; } common_dcl
@@ -205,8 +207,11 @@ xdcl:
        }
 |      LEXPORT xfndcl
        {
-               if($2 != N && $2->nname != N)
-                       exportsym($2->nname->sym);
+               if($2 != N && $2->nname != N) {
+                       dcladj = exportsym;
+                       autoexport($2->nname->sym);
+                       dcladj = nil;
+               }
                $$ = N;
        }
 |      LPACKAGE { warn("package is gone"); } xfndcl