[Bug c++/86440] -Wignored-qualifiers diagnostic highlights wrong token with pointer

dmalcolm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 9 17:58:00 GMT 2018


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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-07-09
     Ever confirmed|0                           |1

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.

Confirmed with trunk, gcc-8, and gcc-7.

gcc-6 and earlier put both warnings on the close-parentheses:

/tmp/test.cc:1:13: warning: type qualifiers ignored on function return type
[-Wignored-qualifiers]
 int const f() { return 0; }
             ^
/tmp/test.cc:3:15: warning: type qualifiers ignored on function return type
[-Wignored-qualifiers]
 int * const g() { return 0; }
               ^


More information about the Gcc-bugs mailing list