public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9048: Conditional expression error with static const members
@ 2002-12-23 14:36 jmc
  0 siblings, 0 replies; 2+ messages in thread
From: jmc @ 2002-12-23 14:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9048
>Category:       c++
>Synopsis:       Conditional expression error with static const members
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 23 14:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     John Collins
>Release:        g++-3.2 (GCC) 3.2 and all previous versions
>Organization:
>Environment:
Mandrake Linux 9.0 3.2-1mdk
>Description:
class  foo  {
        int     some_members;   //.....
public:
        static  const   int     bar1 = 1, bar2 = 2;
        int     some_other_members; // ....
};

int main()
{
        int     x = 1;

        //  This line causes a complaint about undefined
        //  "foo::bar1" and "foo::bar2"

        int     y = x? foo::bar1: foo::bar2;
        int     z;

        //  This does what I expect

        if  (x)
                z = foo::bar1;
        else
                z = foo::bar2;
        return  0;
}
>How-To-Repeat:

>Fix:
If using static const members avoid ?: operator.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c++/9048: Conditional expression error with static const members
@ 2002-12-23 18:42 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-12-23 18:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jmc, nobody

Synopsis: Conditional expression error with static const members

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Mon Dec 23 18:42:09 2002
State-Changed-Why:
    not a bug. you must have an out-of-class definition of your static members.

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


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

end of thread, other threads:[~2002-12-24  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-23 14:36 c++/9048: Conditional expression error with static const members jmc
2002-12-23 18:42 nathan

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