public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3898: broken "do {...} while ()" causes fatal parse error
@ 2001-07-31  9:16 liamq
  0 siblings, 0 replies; only message in thread
From: liamq @ 2001-07-31  9:16 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3898
>Category:       c++
>Synopsis:       broken "do {...} while ()" causes fatal parse error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 31 09:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kyle Schaffrick
>Release:        gcc version 3.0.1 20010626 (prerelease)
>Organization:
>Environment:

>Description:
when a do {...} while (cond); construct is used in a C++ program, if the "while (cond);" is accidentally omitted, an unrecoverable parse error occurs.

the bug causes a Segmentation Fault on RedHat 7.0-bundled version of GCC, but it still exists as a "confused, bailing out" error in the build used by CodeSourcery's online compiler test (used for this bug report). apparently the compiler does not crash anymore, but compilation stops and the obfusicated error messages sometimes make the error difficult to spot.

The compiler output (error messages, warnings, etc):
   src.cpp: In function `int main()':
   src.cpp:10: parse error before `return'
   src.cpp:4: confused by earlier errors, bailing out
>How-To-Repeat:
program: (src.cpp)
int main(void)
{
	int iJunk = 0;
	do {
		iJunk++;
		if (iJunk > 10)
			return 0;
	} // accidental exclusion of "while (cond);"
	  // causes fatal parse error
	return 0;
}

The system type (the dir name after gcc-lib in the output of gcc -v 
   i386-pc-linux-gnu

The complete command line that triggers the bug 
   gcc src.cpp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-07-31  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-31  9:16 c++/3898: broken "do {...} while ()" causes fatal parse error liamq

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).