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

            Bug ID: 120415
           Summary: [14/15 Regression] rejects C++ code
           Product: gcc
           Version: 14.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

works with gcc-14 branch 20250315, fails with the 14.3 release candidate:

$ cat CommandLineParser.ii
struct iterator {
  friend void operator-(iterator __x, long __n) {
    iterator __tmp = __x;
    __tmp -= __n
  }
};


$ g++ -g -Wformat -Werror=format-security -Wdate-time -O0 -pthread -std=c++20
-Wall -Wextra -Wundef -Wno-invalid-offsetof -Wunused-macros
-Wmissing-declarations -Wshadow -Wno-sign-conversion -c CommandLineParser.ii
CommandLineParser.ii: In function 'void operator-(iterator, long int)':
CommandLineParser.ii:4:11: error: no match for 'operator-=' (operand types are
'iterator' and 'long int')
    4 |     __tmp -= __n
      |     ~~~~~~^~~~~~

Reply via email to