public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Chris Kappler" <chrisk@mysticlabs.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/10086: static const int unresolved in ? : construct Date: Sat, 15 Mar 2003 16:56:00 -0000 [thread overview] Message-ID: <20030315165601.25038.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/10086; it has been noted by GNATS. From: "Chris Kappler" <chrisk@mysticlabs.com> To: <bangerth@dealii.org>, <chrisk@mysticlabs.com>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org> Cc: Subject: Re: c++/10086: static const int unresolved in ? : construct Date: Sat, 15 Mar 2003 11:55:43 -0500 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C2EAE9.CED59AA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I do not agree. In the attachment to this email, the commented code compiles perfectly. The uncommented code results in a linker error. I believe that the two pieces of code are semantically equivalent. ----- Original Message ----- From: <bangerth@dealii.org> To: <chrisk@mysticlabs.com>; <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <nobody@gcc.gnu.org> Sent: Friday, March 14, 2003 5:33 PM Subject: Re: c++/10086: static const int unresolved in ? : construct > Synopsis: static const int unresolved in ? : construct > > State-Changed-From-To: open->closed > State-Changed-By: bangerth > State-Changed-When: Fri Mar 14 22:33:31 2003 > State-Changed-Why: > Not a bug. You need a definition of the variable. > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p r=10086 ------=_NextPart_000_0004_01C2EAE9.CED59AA0 Content-Type: application/octet-stream; name="bug.cpp" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bug.cpp" =0A= #include <iostream>=0A= using namespace std;=0A= =0A= class Base {=0A= public:=0A= const static int A =3D 0;=0A= const static int B =3D 1;=0A= };=0A= =0A= class Child : public Base {=0A= public:=0A= void printAB(bool v);=0A= };=0A= =0A= =0A= void Child::printAB(bool v) {=0A= int aa =3D A;=0A= int bb =3D B;=0A= int a =3D (v)?A:B; // causes a linker error=0A= int b =3D (!v)?A:B; // causes a linker error=0A= //int a =3D (v)?aa:bb; // compiles and runs if uncommented=0A= //int b =3D (!v)?aa:bb; // compiles and runs if uncommented=0A= =0A= cout<<"a is "<<a<<" b is "<<b<<endl;=0A= }=0A= =0A= int main() {=0A= Child c;=0A= c.printAB(true);=0A= c.printAB(false);=0A= }=0A= =0A= ------=_NextPart_000_0004_01C2EAE9.CED59AA0--
next reply other threads:[~2003-03-15 16:56 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-15 16:56 Chris Kappler [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-03-16 9:36 Gabriel Dos Reis 2003-03-16 1:06 Giovanni Bajo 2003-03-15 17:06 Wolfgang Bangerth 2003-03-14 22:33 bangerth 2003-03-14 21:36 chrisk
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030315165601.25038.qmail@sources.redhat.com \ --to=chrisk@mysticlabs.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).