On 2014-03-26 15:17, Jason Merrill wrote:

I meant

  struct A
  {
    struct X
    {
      struct B
      {
        void foo(auto);
      };

      void B::foo(auto) {}  // { dg-error "cannot define" }
    };
  };

Here we push both A and X for the declarator.  When we get to the
pushed X, we see that the enclosing scope is A, so we break out of the
loop and don't pop either of the pushed scopes.

Thought I was probably being dense! :) Yes, that will be broken with the current patch. Continuing the loop based on TYPE_BEING_DEFINED might do the trick. I'll try to have a look later.

Cheers,
Adam

Reply via email to