This is the mail archive of the gcc-bugs@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]

[Bug c++/80544] result of const_cast<T* cv> should by cv-unqualified


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80544

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC now accepts the original testcase, and with -Wignored-qualifiers (which is
included in -Wextra) prints:

q.cc: In function ‘int main()’:
q.cc:8:30: warning: type qualifiers ignored on cast result type
[-Wignored-qualifiers]
   f(const_cast<int* const>(&i));
                              ^

I couldn't figure out how to get the caret to point to the ignored qualifier.

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