This is the mail archive of the gcc-patches@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: PR c/25880 improve message of warning for discarding qualifiers


On Mon, May 24, 2010 at 7:20 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Mon, 24 May 2010, Manuel López-Ibáñez wrote:
>
>> Do you mean?
>>
>> + ? ? ?pp_c_ws_string (pp, func_type ? "__atribute__((const))" : "const");
>> + ? ? ?previous = true;
>
> Yes.
>
>> Does it work the same for C++? This function is shared between the two FEs.
>
> I don't know the details of how C++ represents things, but the use of
> qualifiers on function declarations and function types to represent these
> attributes is a language-independent part of GCC's internal
> representation.

C++ has the notion of const member function, which is different from what
GCC means by a function attribute const.

Also CV qualifiers applied to function types in C++ is a very delicate
issue -- witness
the myriads attempt/fixes in both the front-end and the standard.
Printing the cv qualifiers
is even more confusing.

>
> --
> Joseph S. Myers
> joseph@codesourcery.com


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