You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//=== Cpp2 type declarations ====================================================
#include "cpp2util.h"
//=== Cpp2 type definitions and function declarations ===========================
using require_fn = std::function<>;
auto main() -> int;
//=== Cpp2 function definitions =================================================
auto main() -> int{}
The text was updated successfully, but these errors were encountered:
Title: fix(parse): diagnose function expression without initializer
Description:
I tried writing a function type,
but accidentally put a
:
in front.Minimal reproducer (https://cpp2.godbolt.org/z/fdfvs9o1a):
Commands:
cppfront main.cpp2 clang++-18 -std=c++26 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -Werror=unused-variable -I . main.cpp
Expected result: A diagnostic to drop the
:
or add an=
initializer.Actual result and error:
using require_fn = std::function<>;
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: