Consider:
class test {
private:
int n;
int impl () const noexcept {
return n;
}
public:
test () = delet
The rules for where this
can be used changed as a result of core language issue 1207, actually for another reason but in a way that also affects noexcept
expressions.
Before (after C++03, but when C++11 was still being written), this
was not allowed to be used outside a function body. The noexcept
expression is not part of the body, so this
could not be used.
After, this
can be used anywhere after the cv-qualifier-seq, and noexcept
expressions appear after that, as the code in your question clearly illustrates.
It looks like the GCC implementation of this issue is incomplete, and only allows member functions in trailing function return types, but the standard has opened up more than that. I recommend reporting this as a bug (if it has not previously been reported). This has already been reported on GCC bugzilla as bug 52869.
For whatever it's worth, clang accepts the code in C++11 mode.