This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is that code valid ?
- To: engstad at hunt dot inmet dot com (Pal Engstad), egcs at cygnus dot com
- Subject: Re: Is that code valid ?
- From: Jason Merrill <jason at cygnus dot com>
- Date: 25 Nov 1997 10:36:30 -0800
- References: <347A6CE0.82CCAA81.cygnus.egcs@hunt.inmet.com>
>>>>> Pal Engstad <engstad@hunt.inmet.com> writes:
> Lassi Tuuren wrote:
>>
>> Olivier Galibert wrote:
>> > kftabdlg.cpp:549: parse error before `;'
>> > Line 549 is "return(QDate::QDate());"
>> >
>> > Changing that line to "return QDate();" works perfectly though.
>>
>> That is valid code, since the class name is found in its own scope.
>> Hence, one should be able to repeat `QDate::' arbitrary many times. > In
>> other words, assuming the proper declarations, the following is
>> perfectly valid, albeit weird code:
>>
>> return (QDate::QDate::QDate::QDate ());
> Please, do not write things out of thin air in this forum.
No, Lassi is correct. He was referring to
9 Classes [class]
2 A class-name is inserted into the scope in which it is declared imme-
diately after the class-name is seen. The class-name is also inserted
into the scope of the class itself.
Therefore, QDate::QDate refers to QDate.
Jason