From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Derbyshire To: egcs@egcs.cygnus.com, egcs-bugs@egcs.cygnus.com Subject: Confirmed template parsing bug: bug in error message generation. Date: Sun, 28 Feb 1999 22:53:00 -0000 Message-ID: <3.0.6.32.19990228003831.0092f290@pop.globalserve.net> X-SW-Source: 1999-02n/msg01408.html Message-ID: <19990228225300.ieSN9RhEkjakD1NIIYHb5eHQ8fpBpPPn9iQhu7lKVvQ@z> At 07:07 PM 2/27/99 PST, I wrote: > So there are only two possibilities: > 1. A Mandelbug that causes the compiler to barf on legitimate > template instance names under unspecified and complex > circumstances. Or, > 2. A bug that causes it to output a bogus parse error message instead > of a real undeclared name error message under unspecified and > complex conditions. > Either of these is a parser bug, one in parsing itself and one in the > generating of the correct error message for an error. Well, I checked and it seems in my original code, I forgot to import math_traits from a namespace. So there are actually 2 errors, which was the cause of the confusion: Error #1, in my code, missing using declaration causing math_traits to not be in scope, setting me up to be dinged by: Error #2, in egcs, wrong error message is output. Further testing reveals that extern foo baz; and the like will produce bogus parse errors instead of the correct error, which is that the name 'foo' is undeclared. (Copy the above line and paste it into a blank text docuemnt and save as foo.cc, and type gcc foo.cc -W -Wall -Werror -O1. You get foo.cc:1: syntax error before ';' and the correct error is foo.cc:1: 'foo' undeclared foo.cc:1: (Each undeclared identifier is reported only once etc. etc. -- .*. "Clouds are not spheres, mountains are not cones, coastlines are not -() < circles, and bark is not smooth, nor does lightning travel in a `*' straight line." ------------------------------------------------- -- B. Mandelbrot | http://surf.to/pgd.net _____________________ ____|________ Paul Derbyshire pderbysh@usa.net Programmer & Humanist|ICQ: 10423848|