public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7435: g++ rejects certain integral constant expressions
@ 2002-07-29  9:26 loewis
  0 siblings, 0 replies; 4+ messages in thread
From: loewis @ 2002-07-29  9:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7435
>Category:       c++
>Synopsis:       g++ rejects certain integral constant expressions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 29 09:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     loewis@informatik.hu-berlin.de (Martin v. Loewis)
>Release:        3.1
>Organization:
>Environment:
System: SunOS paros 5.9 Generic sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4

	
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../configure --host=sparc-sun-solaris2.8 --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs
>Description:
g++ -pedantic rejects the translation unit

int x[true?(4,5):2];

with the error message

a.cc:1: warning: ISO C++ forbids variable-size array `x'
a.cc:1: variable-size type declared outside of any function

This is incorrect; according to 5.19, a constant-expression is
a conditional-expression. According to 5.16, the syntax allows

  logical-or-expression ? expression : assignment-expression

Since this expression does not violate any of the other constraints
for an integral constant expression, it should be accepted.
>How-To-Repeat:
   Compile the included program with 'g++ -pedantic'
>Fix:
   Work-around: simplify the expression.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/7435: g++ rejects certain integral constant expressions
@ 2003-01-28 16:50 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-01-28 16:50 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, loewis, nobody

Synopsis: g++ rejects certain integral constant expressions

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Tue Jan 28 16:50:54 2003
State-Changed-Why:
    Martin Sebor already explained this: comma-operators are
    not allowed inside constant expressions.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7435


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/7435: g++ rejects certain integral constant expressions
@ 2002-09-17 10:56 Martin Sebor
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Sebor @ 2002-09-17 10:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/7435; it has been noted by GNATS.

From: Martin Sebor <sebor@roguewave.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	loewis@informatik.hu-berlin.de, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c++/7435: g++ rejects certain integral constant expressions
Date: Tue, 17 Sep 2002 11:46:09 -0600

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7435
 
 According to 5.19, p1, constant expressions may not involve the comma
 operator. The test case is ill-formed.
 
 Regards
 Martin
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/7435: g++ rejects certain integral constant expressions
@ 2002-09-13 16:39 nathan
  0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2002-09-13 16:39 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, loewis, nobody

Synopsis: g++ rejects certain integral constant expressions

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Fri Sep 13 16:39:41 2002
State-Changed-Why:
    confirmed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7435


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-28 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-29  9:26 c++/7435: g++ rejects certain integral constant expressions loewis
2002-09-13 16:39 nathan
2002-09-17 10:56 Martin Sebor
2003-01-28 16:50 bangerth

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).