Skip to content

[BUG] Can't access conversion function #583

@JohelEGP

Description

@JohelEGP

Title: Can't access conversion function.

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

#include <type_traits>
zero: type == std::integral_constant<int, 0>;
main: () -> int = zero().operator int();
// int main() { return zero().operator int(); }
Commands:
cppfront main.cpp2
clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp

Expected result: Same as using the commented out Cpp1 main.

Actual result and error:

main.cpp2(3,35): error: ill-formed initializer (at 'int')
main.cpp2(3,1): error: unexpected text at end of Cpp2 code section (at 'main')
main.cpp2(2,0): error: parse failed for section starting here

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions