compile-time-regular-expressions icon indicating copy to clipboard operation
compile-time-regular-expressions copied to clipboard

ICE on MSVC

Open jeremy-rifkin opened this issue 3 years ago • 6 comments
trafficstars

I'm getting an internal compiler error on MSVC with the current code in trunk: https://godbolt.org/z/jexjEsj61

https://raw.githubusercontent.com/hanickadot/compile-time-regular-expressions/5b914a62c71c6c6b336fd466a4e812db635b9fdc/single-header/ctre.hpp(5114): fatal error C1001: Internal compiler error.
(compiler file 'd:\a01\_work\49\s\src\vctools\Compiler\CxxFE\sl\p1\c\constexpr\constexpr.cpp', line 8618)
 To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com 
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
https://raw.githubusercontent.com/hanickadot/compile-time-regular-expressions/5b914a62c71c6c6b336fd466a4e812db635b9fdc/single-header/ctre.hpp(5126): note: see reference to class template instantiation 'ctre::regex_builder<ctll::fixed_string<9> const `std::basic_string<char,std::char_traits<char>,std::allocator<char> > __cdecl asserts::utility::strip_colors(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)'::`2'::ansi_escape_pattern>' being compiled
<source>(10): note: see reference to variable template 'const auto search<&`asserts::utility::strip_colors'::`2'::ansi_escape_pattern>' being compiled
<source>(29): note: see reference to function template instantiation 'std::string ctre_replace<& ctll::fixed_string<9> const `std::basic_string<char,std::char_traits<char>,std::allocator<char> > __cdecl asserts::utility::strip_colors(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)'::`2'::ansi_escape_pattern>(std::string_view,std::string_view)' being compiled
INTERNAL COMPILER ERROR in 'C:\data\msvc\14.30.30709-v2\bin\Hostx64\x64\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information

edit: goes at least as far back 2.5

jeremy-rifkin avatar May 09 '22 20:05 jeremy-rifkin

Please report the bug to Microsoft. Internal compiler error is always a bug in compiler. Please link it here then.

hanickadot avatar May 09 '22 20:05 hanickadot

Thank you, I will do so. I figured I'd post here in case there's any way to work around it in the library and in case it warrants updating the supported compilers section of the readme.

jeremy-rifkin avatar May 09 '22 20:05 jeremy-rifkin

You should try latest version, it seems there is one. CTRE is tricky for compilers :)

hanickadot avatar May 09 '22 20:05 hanickadot

Understandable :) I'm seeing it compiling fine with /std:c++20 at least!

jeremy-rifkin avatar May 09 '22 20:05 jeremy-rifkin

yeah, you should always use /std:c++20 or higher, CTRE working in 17 mode is just a pure serendipity

hanickadot avatar May 09 '22 20:05 hanickadot

Good to know, thanks so much for the quick reply!

jeremy-rifkin avatar May 09 '22 20:05 jeremy-rifkin