[Bug c++/80544] result of const_cast<T* cv> should by cv-unqualified
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 25 04:07:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list