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 ===========================externboolconst v;
//=== Cpp2 function definitions =================================================boolconst v {true};
_cppfront/main-3.cpp:
//=== Cpp2 type declarations ====================================================
#include"cpp2util.h"template<typename T> requires( v )
class t;
//=== Cpp2 type definitions and function declarations ===========================
#include"main.h"template<typename T> requires( v )
class t {
public:t() = default;
public:t(t const&) = delete; /* No 'that' constructor, suppress copy */public:autooperator=(t const&) -> void = delete;
};
automain() -> int;
//=== Cpp2 function definitions =================================================automain() -> int{}
Title: Can't use
#include
d declaration in requires clause.Description:
A header include is treated like Cpp1 code and is emitted in phase 2.
A forward declaration in phase 1 can't make use of the header's symbols.
Minimal reproducer (https://cpp2.godbolt.org/z/fa4a7Kdo6):
main.h2
:main.cpp2
:Commands:
cppfront main.h2 -o _cppfront/main.h cppfront main.cpp2 -o _cppfront/main-3.cpp clang++17 -std=c++2b -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . _cppfront/main-3.cpp
Expected result:
A well-formed program.
Actual result and error:
Cpp2 lowered to Cpp1.
_cppfront/main.h
:_cppfront/main-3.cpp
:Output.
The text was updated successfully, but these errors were encountered: