[gnu.g++.bug] local anonymous struct problem

jjc@UUNET.UU.NET (James Clark) (05/18/89)

Script started on Thu May 18 14:31:56 1989
jclark% cat bug.c
class A {
  int n;
public:
  void foo();
};

void A::foo()
{
  struct {
    int a;
  } x;
  x.a = n;
}
jclark% /u/local/g++/g++ -B/u/local/g++/ -v -g -c bug.c
g++ version 1.35.0
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ bug.c /tmp/cca07365.cpp
GNU CPP version 1.35
 /u/local/g++/cc1plus /tmp/cca07365.cpp -quiet -dumpbase bug.c -noreg -version -G -o /tmp/cca07365.s
GNU C++ version 1.35.0 (sparc) compiled by GNU C version 1.35.
In method void A::foo ():
bug.c:12: `n' was not declared (first use this function)
bug.c:12: (Each undeclared identifier is reported only once
bug.c:12: for each function it appears in.)
jclark% exit
jclark% 
script done on Thu May 18 14:32:08 1989

This worked correctly with 1.34.2.

James Clark
jjc@jclark.uucp