This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26058] [4.0/4.1/4.2 Regression] C++ error recovery regression



------- Comment #8 from mark at codesourcery dot com  2006-05-31 22:56 -------
Subject: Re:  [4.0/4.1/4.2 Regression] C++ error recovery regression

sabre at nondot dot org wrote:
> ------- Comment #7 from sabre at nondot dot org  2006-05-31 22:17 -------
> Ok, makes sense.  The strategy that made sense to me was "If I see a definition
> for something that obviously has to be at global scope, but is defined inside
> of a function, pop all the way out to global scope and continue, there must be
> a missing }". 

One could attempt that -- but it would be hard.  It would also fall
afoul of code like this:

  void f() {
    void g() {} // Must be at global scope, but I didn't know that.
    g();
  }

which is likely to be another common error mode, since:

  void f() {
    void g();
    g();
  }

is valid.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26058


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]