[Bug c++/87174] New: virt-specifier not recognized on function declared like a variable

blitzrakete at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Aug 31 18:06:00 GMT 2018


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

            Bug ID: 87174
           Summary: virt-specifier not recognized on function declared
                    like a variable
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blitzrakete at gmail dot com
  Target Milestone: ---

Gcc (no flags) doesn't compile the following code:

using F = void();

struct X {
  virtual F f;
};

struct Y : X {
  F f override;
};

Clang can compile this code just fine. The (trimmed) error message is:

<source>:8:5: error: expected ';' at end of member declaration
<source>:8:7: error: 'override' does not name a type


More information about the Gcc-bugs mailing list