// RUN: clang-cc -fsyntax-only -verify %s 

void f1() {
  struct X {
    struct Y;
  };
  
  struct X::Y {
    void f() {}
  };
}

void f2() {
  struct X {
    struct Y;
    
    struct Y {
      void f() {}
    };
  };
}

// A class nested within a local class is a local class.
void f3(int a) { // expected-note{{'a' declared here}}
  struct X {
    struct Y {
      int f() {
        return a; // expected-error{{reference to local variable 'a' declared in enclosed function 'f3'}}
        return 1;
      }
    };
  };
}

// RUN: clang-cc -fsyntax-only -verify %s 

void f1() {
  struct X {
    struct Y;
  };
  
  struct X::Y {
    void f() {}
  };
}

void f2() {
  struct X {
    struct Y;
    
    struct Y {
      void f() {}
    };
  };
}

// A class nested within a local class is a local class.
void f3(int a) { // expected-note{{'a' declared here}}
  struct X {
    struct Y {
      int f() { return a; } // expected-error{{reference to local variable 'a' declared in enclosed function 'f3'}}
    };
  };
}

Revert this, we have a better way to do this.
Revert this, we have a better way to do this.


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@76687 91177308-0d34-0410-b5e6-96231b3b80d8
