[Bug c++/87961] New: crash at goto label inside sizeof

2018-11-09 Thread eugvelesevich at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87961

Bug ID: 87961
   Summary: crash at goto label inside sizeof
   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.cpp:
int main() {
sizeof(({M:0;}));
goto M;
}
output:
In function ‘int main()’:
:1:5: internal compiler error: Segmentation fault
 int main() {
 ^~~~


Code is a little strange... clang gets sigsegv too :)

[Bug c++/88003] New: ICE on outside definition of inner function-local class in poplevel_class, at cp/name-lookup.c:4325

2018-11-13 Thread eugvelesevich at gmail dot com
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?