Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to compile (infinite loop, another situation) #81

Open
nakrakiiya opened this issue Jan 2, 2025 · 0 comments
Open

fail to compile (infinite loop, another situation) #81

nakrakiiya opened this issue Jan 2, 2025 · 0 comments

Comments

@nakrakiiya
Copy link

Version: latest in vcpkg (2024.12)
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34435 for x64 (latest msvc)

Code to reproduce:

#include <ctpg/ctpg.hpp>
#include <utility>

constexpr char id_pattern[] = "[_A-Za-z][_A-Za-z0-9]";
constexpr ctpg::regex_term<id_pattern> id("identifier");

constexpr char function_like_name_with_lparen_pattern[] = "[_A-Za-z][_A-Za-z0-9]*\\(";
constexpr ctpg::regex_term<function_like_name_with_lparen_pattern> function_like_name_with_lparen("function_like_name_with_lparen");

constexpr ctpg::nterm<std::string> line("line");

constexpr ctpg::parser parser(
    line,
    terms(function_like_name_with_lparen, id),
    nterms(line),
    rules(line(id) >= std::identity {}));

Messages:

C:\PROGRA~1\MIB055~1\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\cl.exe  /nologo /TP -D_CRT_SECURE_NO_WARNINGS -ID:\source\expand\src\utils -external:ID:\source\expand\out\build\Debug\vcpkg_installed\x64-windows\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -std:c++latest -MDd -Zi -utf-8 -W4 /showIncludes @expand\CMakeFiles\expand.dir\bug.cpp.obj.modmap /Foexpand\CMakeFiles\expand.dir\bug.cpp.obj /Fdexpand\CMakeFiles\expand.dir\ /FS -c D:\source\expand\src\expand\bug.cpp
D:\source\expand\src\expand\bug.cpp(12): error C2131: expression did not evaluate to a constant
D:\source\expand\out\build\Debug\vcpkg_installed\x64-windows\include\ctpg/ctpg.hpp(1303): note: failure was caused by evaluation exceeding step limit of 1048576 (/constexpr:steps<NUMBER>)
ninja: build stopped: subcommand failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant