This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ FE stripping const qualifiers from function prototypes (bug or feature?)


Daniel Berlin wrote:
> On Thu, Mar 12, 2009 at 9:32 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
>> Hi,
>>> Notice how the third argument is 'int' instead of 'const int'.  Is
>>> this the way C++ is supposed to behave or is this a bug in the FE?
>>>
>> Well, I would say this is a rather well known C++ feature not a bug. It
>> took me a little time finding the exact section of the standard where it
>> is stated but I think finally I found it: but last item of 13.1/3. Also,
>> 8.3.5/3.
>>
> 
> But if it was following this and removing const qualifiers, shouldn't
> it have remove the const from const char * too?
> Or am i missing something?

  It would remove the const from char * const, not from char const *.

    cheers,
      DaveK




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]