Issue 100863
Summary [Clang] Member function definitions of local classes outside the class not rejected
Labels clang
Assignees
Reporter MitalAshok
    E.g. <https://godbolt.org/z/8qsqvWo1x>:

```c++
auto f() {
    struct {
        int g();
    } x;
    return x;
}

using x_t = decltype(f());
int x_t::g() {
    return 1;
}

int main() {
    return f().g();
}
```

is ill-formed because of [[class.mfct]p3](https://wg21.link/class.mfct#3):

> Member functions of a local class shall be defined inline in their class definition, if they are defined at all.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to