https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88003
Bug ID: 88003
Summary: ICE on outside definition of inner function-local
class in poplevel_class, at cp/name-lookup.c:4325
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eugvelesevich at gmail dot com
Target Milestone: ---
Source:
auto test() {
struct O {
struct N;
};
return O();
}
struct decltype(test())::N {};
Output:
g++ -std=c++14 -S -x c++ -
source>:8:29: internal compiler error: in poplevel_class, at
cp/name-lookup.c:2931
struct decltype(test())::N {};
^
All gcc versions supporting c++14 crash.
I'm not sure that decltype usage in this place is correct, but it can be
replaced with:
typedef decltype(test()) TN;
struct TN::N {};
Could be related to bug #84691?