🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by David Bowser-Chao Thu, 29 Feb 1996 18:28
double& rd2 = 2.0; // error?
#909
Author: David Bowser-Chao
Date: Thu, 29 Feb 1996 18:28
25 lines
1836 bytes
Looking at the April 1995 working draft proposal,
the fragment:

   double& rd2 = 2.0; 

is deemed illegal (non-const references are not initialized from 
temporaries) but the GNU g++ 2.7.2 as well as the DEC VMS compiler 
(current release, don't remember, as well as the version I'm 
field-testing) allow this statement with a mere warning.

This seems like a very basic thing to *fix* - am I missing something 
here, is this supposed to be an error, or since April has the committee 
changed its mind(s)?
-- 
David Bowser-Chao               | http://www.pa.msu.edu/people/davechao
High Energy Theoretical Physics | davechao@cteq07.pa.msu.edu
Michigan State University       |
(517) 432-1668                  |
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Re: double& rd2 = 2.0; // error?
#910
Author: Fergus Henderson
Date: Fri, 01 Mar 1996 17:02
34 lines
2049 bytes
David Bowser-Chao <davechao@cteq07.pa.msu.edu> writes:

>Looking at the April 1995 working draft proposal,
>the fragment:
>
>   double& rd2 = 2.0; 
>
>is deemed illegal (non-const references are not initialized from 
>temporaries)

The draft standard does not use the term "illegal".
It uses the term "ill-formed".

>but the GNU g++ 2.7.2 as well as the DEC VMS compiler 
>(current release, don't remember, as well as the version I'm 
>field-testing) allow this statement with a mere warning.

According to the draft standard, compilers are not required
to issue errors for ill-formed code; they are allowed to issue
mere warnings.

--
Any mail to me between Feb 24th and 27th may have gone to the bit bucket
(#&$^@$!# mail software silently ignored disk full error).  Please resend.
(comp.std.c++ articles were not affected, so no need to resend those.)
Fergus Henderson             	WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au              	PGP: finger fjh@128.250.37.3
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads