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

--- Comment #8 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
One can avoid ICE in the example, if put the definition of `O::N` in a
namespace, e.g.:
```
namespace {

using O = decltype(test());

struct O::N {};

}
```
Online demo: https://gcc.godbolt.org/z/e61fKjor7
However other compilers dislike it.

But overall, the code from the original report seems invalid in C++23 per
https://timsong-cpp.github.io/cppwp/n4950/class.local#3
> If class X is a local class a nested class Y may be declared in class X
> and later defined in the definition of class X
> or be later defined in the same scope as the definition of class X. 
which mandates that O::N be defined only within the function test(). See the
discussion: https://stackoverflow.com/q/79808341/7325599

Reply via email to