This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22590] parser does not recover well after error
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 23:11:41 -0000
- Subject: [Bug c++/22590] parser does not recover well after error
- References: <20050721143121.22590.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2005-07-21 23:11 -------
With Andrew's little testcase, I get
g/x> cat > x.cc
include "core.hh"
typedef unsigned int size_t;
namespace std
{
using ::size_t;
}
g/x> /home/bangerth/bin/gcc-4.1-pre/bin/c++ -c x.cc
x.cc:1: error: expected constructor, destructor, or type conversion before
string constant
x.cc:5: error: ‘::size_t‘ has not been declared
I guess that's as good as it gets: it doesn't understand your include
statement
(understandably so) and then keeps reading. Since there is no semicolon
after the botched include, it skips the rest of the presumed statement
until after your declaration of ::size_t. The next error is where you
use ::size_t, which of course it doesn't know.
What's wrong with this?
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22590