Topic: Compiler inconsistency with static member fn


Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Sun, 17 Oct 1993 20:00:07 GMT
Raw View
In article <1993Oct13.001737.4187@borland.com> pete@borland.com (Pete Becker) writes:
>In article <1993Oct12.211625.15924@ctp.com>, Mel Menezes <mmene@ctp.com> wrote:
>>I tried compiling the following program in Borland C++ for windows:
>>
>>============  Included code  ===================
>>
>>class X
>>{
>> static const char * const fn() const {};
>>};
>>
>>main() {}
>>
>>==========  End of Included code  ===============
>>
>>BCW complains with an error "Conflicting type modifiers" on the line
>>containing the member function (X::fn()).  If I remove the static, the
>>program compiles fine.
>>
>
> If you remove the last 'const' the program should also compile fine.
>It's not legal to declare a static member function to be const. It's also
>meaningless.
> -- Pete

I'm inclined to agree with your assertion Pete, but (as I often do) I'd
like to just point out that I can find no such restriction in either section
9.3.1 or 9.4 of the current X3J16 working paper.  (May I also assume that
no such restriction is stated in the corresponding sections of the ARM
either?)

(Follow-ups to comp.std.c++ please.)

--

-- Ronald F. Guilmette ------------------------------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------