cppfront
cppfront copied to clipboard
A personal experimental C++ Syntax 2 -> Syntax 1 compiler
**[T](#title)itle**: Function expression in alias has access specifier. **[M](#rep)inimal reproducer** (): ```Cpp2 v: @struct type = { f: std::type_identity_t == :(_: int) 0; g: (i) i.f(); } main: () =...
**[T](#title)itle**: Raw string with `{}` doesn't parse. **[M](#rep)inimal reproducer** (): ```Cpp2 main: () = { _ = R"({ })"; } ``` Commands: ```bash cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors...
**[T](#title)itle**: Can't declare constexpr variable of pointer type. **[M](#rep)inimal reproducer** (): ```Cpp2 main: () = { _: * const char == "abc"; } ``` Commands: ```bash cppfront main.cpp2 clang++18 -std=c++23...
# Restore `in` optimization for class types At first, `in` parameters were optimized for class types. Cppfront's optimization of `in` parameters was faithful to [F.16][]: For “in” parameters, pass cheaply-copied...
# Description The result of initialization is surprising because by changing the placement of `=`, its result can be changed, and no one expects to have a different result from...
**[T](#title)itle**: Can't capture in `assert` in function expression. **[M](#rep)inimal reproducer** (): ```Cpp2 main: () = { pred = : (y: T) requires !std::is_same_v = {}; _ = :(x) = {...
**[T](#title)itle**: Moved statement parameter parsed as parameter list when accessed. **[M](#rep)inimal reproducer** (): ```Cpp2 main: (args) = { (copy x: args) { (move x).clear(); } } ``` Commands: `cppfront main.cpp2`...
**[T](#title)itle**: Ambiguous `as` cast with `-add-source-info`. **[M](#rep)inimal reproducer** (): ```Cpp2 main: () = { i := 0; _ = i as std::size_t; } ``` Commands: ```bash cppfront main.cpp2 clang++18 -std=c++23...
**[T](#title)itle**: Postfix operators of member assignment ignored. **[M](#rep)inimal reproducer** (): ```Cpp2 spanning_vector: type = { view: * std::vector; operator=: (out this, inout v: std::vector) = view = v&; operator=: (inout...
Hi, I attempted to poke around the cppfront compiler, and the moment I added a second translation unit, I ran into linker errors (symbol redefinitions) because there are many functions...