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

            Bug ID: 120628
           Summary: GCC emits incorrect warnings/errors for identifiers
                    "final" and "override" in C++98 mode
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: de34 at live dot cn
  Target Milestone: ---

The following code snippet is well-formed in C++98 and later.

```
struct C {};
struct C final = {};
struct C override = {};
```

But GCC seems confused by the change in C++11 that made `final` and `override`
contextual keywords, and emits incorrect pedantic errors in the ancient mode
(https://godbolt.org/z/T5d1467rh). The status quo seems to start since GCC 4.7.

Reply via email to