cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

[BUG] Non-object declaration before `this` member ICEs

Open JohelEGP opened this issue 2 years ago • 2 comments
trafficstars

Title: Non-object declaration before this member ICEs.

Minimal reproducer (https://cpp2.godbolt.org/z/Kdbz8h311):

my_time: type = {
  rep: type == cpp2::longdouble;
  this: duration;
}
main: () = { }
Commands:
cppfront main.cpp2
clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp

Expected result: A well-formed program.

Actual result and error: Segmentation fault (core dumped).

See also:

JohelEGP avatar Nov 15 '23 03:11 JohelEGP

Thanks!

hsutter avatar Nov 15 '23 18:11 hsutter

Thank you. But it's not just aliases. It's all non-object declarations. So now it works for using statements and alias declarations. This one still segfaults:

my_time: type = {
  f: () 0;
  this: duration;
}
main: () = {}

JohelEGP avatar Nov 15 '23 19:11 JohelEGP