This is the mail archive of the gcc-prs@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]

c++/3406: Parse error on valid expression



>Number:         3406
>Category:       c++
>Synopsis:       ( int() > int() ) gives parse error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 25 07:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bill Somerville
>Release:        @gcc_version_full@
>Organization:
Class Design Ltd.
>Environment:
System: Linux wallace.classdesign.com 2.2.9-19mdk #2 Sun Nov 14 18:37:33 GMT 1999 i586 unknown
Architecture: i586

host: @host@
build: @build@
target: @target@
configured with: @gcc_config_arguments@
>Description:

	int main()
	{
		( int() > int() );
		return 0;
	}

gives:
	$ c++ t.cpp
	t.cpp: In function `int main()':
	t.cpp:3: parse error before `>' token

>How-To-Repeat:
	See code sample above. Also fails with user defined type default constructor calls. This was detected in a test harness that exercises comparison operators on default constructed objects - perhaps a similar test should be included in the compiler testsuite.
>Fix:
	Not a work around, but if the parenthesis around the offending expression are removed, the expression compiles as expected. In my case not feasable as the expression is mixed with i/o stream inserters.
>Release-Note:
>Audit-Trail:
>Unformatted:


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