cppfront
cppfront copied to clipboard
[BUG] Can't have `@enum` named `type`
trafficstars
Title: Can't have @enum named type.
Minimal reproducer (https://cpp2.godbolt.org/z/7PcYzn3Eo):
type: @enum type = {
range_difference;
}
declaration: @struct type = {
name: std::string_view;
type: type;
}
main: () = { }
Commands:
cppfront main.cpp2
clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -I . main.cpp
Expected result: The type of the added constants to be qualified to avoid clashing with Cpp2 syntax.
Actual result and error:
Output:main.cpp2...
main.cpp2: error: a 'type ==' alias declaration must be followed by a type name
main.cpp2(1,1): error: while applying @enum - error attempting to add member:
range_difference : type == 0;
main.cpp2(7,13): error: a user-defined type must have an = initializer (at ';')
See also:
- #704.