hanickadot / compile-time-regular-expressions

Compile Time Regular Expression in C++
https://twitter.com/hankadusikova
Apache License 2.0
3.32k stars 183 forks source link

Can't compile in Clang 12 or later with `-std=c++17` #234

Closed remyjette closed 2 years ago

remyjette commented 2 years ago

The readme states "clang 12.0+ (C++17 syntax, C++20 cNTTP syntax)"

But beginning with clang 12, just #include <ctre.hpp> causes a compilation error with -std=c++17

/opt/compiler-explorer/libs/ctre/main/include/ctll/parser.hpp:25:29: error: use of class template 'fixed_string' requires template arguments; argument deduction not allowed in template parameter
template <typename Grammar, ctll::fixed_string input, typename ActionSelector = empty_actions, bool IgnoreUnknownActions = false> struct parser { // in c++20

https://godbolt.org/z/Ph85TM7En

If I go back to clang 11, it works. If I switch to -std=c++20, it works. But on clang 12/13/trunk with std=c++17 I get the above error.

exief commented 2 years ago

I'm also getting the same error with clang-tidy 13

jarzec commented 2 years ago

Same issue here. I was about to create a twin of your PR 😄. Fortunately I decided to read through the existing ones first. Let's hope the fix gets integrated soon.

hanickadot commented 2 years ago

should be fixed in latest main