a step backward for references in egcs-980615 ?

David C Binderman dcb@pncl.co.uk
Wed Jun 17 13:26:00 GMT 1998


Hello there,

For the following code

struct S
{
	int & ref;
	S() : ref() {	// error, since no initor for ref
	};
};

I get

../gnu/Results.egcs-980531.1/bin/g++

jun17.cc: In method `S::S()':
jun17.cc:5: Error: incomplete initializer for member `S::ref' of class `S'
which has no
constructor

../gnu/Results.egcs-980608.1/bin/g++

jun17.cc: In method `S::S()':
jun17.cc:5: Error: incomplete initializer for member `S::ref' of class `S'
which has no
constructor

../gnu/Results.egcs-980615.1/bin/g++

jun17.cc: In method `S::S()':
jun17.cc:5: warning: initialization of non-const reference `int &' from
rvalue `int'




Note how a perfectly ok error has become a different warning.

Regards


David Binderman MSc BSc    +44 1293 534 847       dcb_AVOID_JUNK_MAIL@pncl.co.uk
There is no substitute for skill, taste and experience when programming
 - Dr Stroustrup, inventor of C++




More information about the Gcc-bugs mailing list