Path: utzoo!telly!attcan!uunet!bu-cs!ncsuvx!mcnc!rti!xyzzy!bert!coleman From: coleman@bert.dg.com (Kim Coleman) Newsgroups: gnu.g++.bug Subject: g++ 1.34.1 & uninitialized references Summary: compiler doesn't always catch them Keywords: references Message-ID: <4609@xyzzy.UUCP> Date: 28 Mar 89 17:47:34 GMT Sender: usenet@xyzzy.UUCP Reply-To: coleman@bert.dg.com (Kim Coleman) Distribution: gnu Organization: Data General Corporation, Research Triangle Park, NC. Lines: 21 // Test that the compiler catches uninitialized references. Given that // references are conceptually an object rename, they must be initialized // to something (see Stroustrap, p. 56). At best, g++ gives a warning, // at worst, it says nothing at all. void some_function() { int& a_ref; // g++ gives a warning } class erroneous { int& a_ref; // g++ says nothing }; Personally, I think both these cases should be an error, but a warning is better than nothing. Sorry if this has been posted before. --------------------------- Kim Coleman Data General Corp., Research Triangle Park, NC {the world}!mcnc!rti!dg-rtp!coleman