buck-yeh / parsergen

Self-hosted parser/scanner generator from LR grammar with semantic annotations in C++20
MIT License
7 stars 0 forks source link

clang fails to compile: error: expected concept name with optional arguments #7

Closed yurivict closed 2 years ago

yurivict commented 2 years ago
In file included from /disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/BNFContext.cpp:1:
In file included from /disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/BNFContext.h:5:
In file included from /disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/Logger.h:3:
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:44:31: error: expected concept name with optional arguments
        { holder.stream() }-> std::convertible_to<std::ostream*>;
                              ^
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:152:15: error: no template named 'derived_from' in namespace 'std'
template<std::derived_from<std::ostream> T_Sink>
         ~~~~~^
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:153:26: error: template argument for template type parameter must be a type
struct C_AutoSinkHolderT<T_Sink>
                         ^~~~~~
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:98:16: note: template parameter is declared here
template<class C_LogImpl>
               ^
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:189:15: error: no template named 'derived_from' in namespace 'std'
template<std::derived_from<I_SnapT<std::ostream*>> T_Sink>
         ~~~~~^
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:190:26: error: template argument for template type parameter must be a type
struct C_AutoSinkHolderT<T_Sink>
                         ^~~~~~
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/SyncLog.h:98:16: note: template parameter is declared here
template<class C_LogImpl>
               ^
In file included from /disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/BNFContext.cpp:3:
/disk-samsung/freebsd-ports/devel/parsergen/work/parsergen-1.7.0-9-gbda59af/ParserGen/../../bux/include/bux/FsUtil.h:4:10: fatal error: 'ranges' file not found
#include <ranges>       // std::ranges::forward_range<>
         ^~~~~~~~
6 errors generated.

clang-12 FreeBSD 13

buck-yeh commented 2 years ago

Last time I checked clang is having issues with range library rooted in unsupported C++20 language feature Make typename more optional. Please find P0634R3 in https://en.cppreference.com/w/cpp/compiler_support

My recommendation: Don't build my projects with clang until clang fixes the problems.

buck-yeh commented 2 years ago

This issue is closed with the same root cause with #8