Where does the 'override' qualifier go with trailing return types?
like this:
class I
{
virtual auto Func() -> void = 0;
};
class C : public I
{
auto Func() -> void override;
};
It works in gcc since 4.8.1:
https://godbolt.org/z/TbTTwa
According to the standard, 8.4.1, a declarator for a function includes the trailing-return-type, and a class function definition contains "declarator virt-specifier-seqopt". The second one, virt-specifier-seq, is one of final
or override
, so those come after the trailing return type. (I.e. Clang gets it right.)