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++/86440] New: -Wignored-qualifiers diagnostic highlights wrong token with pointer


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

            Bug ID: 86440
           Summary: -Wignored-qualifiers diagnostic highlights wrong token
                    with pointer
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

$ cat a.cc
int const f() { return 0; }

int * const g() { return 0; }


$ g++ a.cc -c -Wignored-qualifiers
a.cc:1:5: warning: type qualifiers ignored on function return type
[-Wignored-qualifiers]
 int const f() { return 0; }
     ^~~~~
a.cc:3:1: warning: type qualifiers ignored on function return type
[-Wignored-qualifiers]
 int * const g() { return 0; }
 ^~~

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