public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/396: const int null = 0;
@ 2002-11-20 18:49 Wolfgang Bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bangerth @ 2002-11-20 18:49 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/396: const int null = 0;
Date: Thu, 14 Nov 2002 14:32:21 -0600

 Re-confirmed with 3.3 CVS from 2002-11-10 and 3.2.1 pre from the same date.


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

* Re: c++/396: const int null = 0;
@ 2002-10-22 15:46 Wolfgang Bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bangerth @ 2002-10-22 15:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/396: const int null = 0;
Date: Tue, 22 Oct 2002 17:40:47 -0500 (CDT)

 I don't actually know what the standard would mandate in this case 
 (conversion from 'const int &' to 'int *'), but this is clearly at least 
 confusing (stripped down and condensed testcase from this report):
 -----------------------------------
 void f(int* pn);
 
 struct Foo {
     static void f(int* pn);
 };
 
 int main() {
   const int null = 0;
 
   f(0);    // ok
   f(null); // ok
   
   Foo::f(0);    // ok
   Foo::f(null); // compile error
 }
 ----------------------------------
 The compiler only gives an error on the call to Foo::f(), not on ::f(), 
 although they have the same signature. For present CVS and 3.2, the error 
 message is
 x.cc: In function `int main()':
 x.cc:14: error: invalid conversion from `int' to `int*'
 x.cc:14: error:   initializing argument 1 of `static void Foo::f(int*)'
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

end of thread, other threads:[~2002-11-14 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-20 18:49 c++/396: const int null = 0; Wolfgang Bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-10-22 15:46 Wolfgang 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).