This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80544] result of const_cast<T* cv> should by cv-unqualified
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 May 2017 22:19:56 +0000
- Subject: [Bug c++/80544] result of const_cast<T* cv> should by cv-unqualified
- Auto-submitted: auto-generated
- References: <bug-80544-4@http.gcc.gnu.org/bugzilla/>
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.