home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12474 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.3 KB  |  42 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!m.cs.uiuc.edu!sunb10.cs.uiuc.edu!sparc10.cs.uiuc.edu!pjl
  3. From: pjl@sparc10.cs.uiuc.edu (Paul Lucas)
  4. Subject: Re: References as class members
  5. Message-ID: <1992Aug18.042640.13963@sunb10.cs.uiuc.edu>
  6. Sender: news@sunb10.cs.uiuc.edu
  7. Organization: University of Illinois at Urbana-Champaign
  8. References: <LVI.92Aug14161521@aste27.ida.liu.se> <1992Aug16.221328.4934@sunb10.cs.uiuc.edu>
  9. Distribution: usa
  10. Date: Tue, 18 Aug 1992 04:26:40 GMT
  11. Lines: 29
  12.  
  13. In <1992Aug16.221328.4934@sunb10.cs.uiuc.edu> pjl@sparc10.cs.uiuc.edu (Paul Lucas) writes:
  14.  
  15. >In <LVI.92Aug14161521@aste27.ida.liu.se> lvi@ida.liu.se (Lars Viklund) writes:
  16.  
  17.  
  18. >>Is the following class declaration legal?
  19.  
  20. >>class X {
  21. >>    X& r;
  22. >>};
  23.  
  24. >*****>    Yes.
  25.  
  26. *****>    I read the question bass-ackwards...could have *sworn* it said 
  27.     illegal.  Now then, given ARM 12.6.2 and some inferrential
  28.     ability, it's not (currently) legal.
  29.  
  30. >>According to ARM it should be OK, but the ObjectCenter 1.1 compiler
  31. >>and Sun CC 2.1 claims that the reference must have a constructor.
  32.  
  33. >*****>    And they're both correct.
  34.  
  35. >>GCC compiles it without complaining.
  36.  
  37. >*****>    Then GCC has a bug.
  38. -- 
  39.     - Paul J. Lucas                University of Illinois    
  40.       AT&T Bell Laboratories        at Urbana-Champaign
  41.       Naperville, IL            pjl@cs.uiuc.edu
  42.