@@ -32,10 +32,12 @@ template <typename CharT, size_t N> fixed_string(const CharT (&)[N]) -> fixed_st
3232
3333#if __cpp_nontype_template_parameter_class
3434template <ctll::basic_fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto re () noexcept {
35+ constexpr auto _input = input; // workaround for GCC 9 bug 88092
3536#else
3637template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto re () noexcept {
38+ constexpr auto & _input = input;
3739#endif
38- constexpr auto _input = input;
40+
3941 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
4042 static_assert (tmp (), " Regular Expression contains syntax error." );
4143 using re = decltype (front (typename tmp::output_type::stack_type ()));
@@ -49,7 +51,7 @@ template <typename T> void identify(T);
4951
5052#if __cpp_nontype_template_parameter_class
5153template <ctll::basic_fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto match (std::string_view sv) noexcept {
52- constexpr auto _input = input;
54+ constexpr auto _input = input; // workaround for GCC 9 bug 88092
5355 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
5456 static_assert (tmp (), " Regular Expression contains syntax error." );
5557 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
@@ -58,8 +60,8 @@ template <ctll::basic_fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLI
5860}
5961#else
6062template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto match (std::string_view sv) noexcept {
61-
62- using tmp = typename ctll::parser<ctre::pcre, input , ctre::pcre_actions>::template output<pcre_context<>>;
63+ constexpr auto & _input = input;
64+ using tmp = typename ctll::parser<ctre::pcre, _input , ctre::pcre_actions>::template output<pcre_context<>>;
6365 static_assert (tmp (), " Regular Expression contains syntax error." );
6466 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
6567 auto re_obj = ctre::regular_expression<re>(re ());
@@ -70,15 +72,15 @@ template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto match(std:
7072
7173#if __cpp_nontype_template_parameter_class
7274template <ctll::basic_fixed_string input, typename ForwardIt> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto match (ForwardIt first, ForwardIt last) noexcept {
73- constexpr auto _input = input;
75+ constexpr auto _input = input; // workaround for GCC 9 bug 88092
7476 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
7577 static_assert (tmp (), " Regular Expression contains syntax error." );
7678 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
7779 return ctre::regular_expression (re ()).match (first, last);
7880}
7981#else
8082template <auto & input, typename ForwardIt> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto match (ForwardIt first, ForwardIt last) noexcept {
81- constexpr auto _input = input;
83+ constexpr auto & _input = input;
8284 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
8385 static_assert (tmp (), " Regular Expression contains syntax error." );
8486 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
@@ -90,8 +92,7 @@ template <auto & input, typename ForwardIt> CTRE_FLATTEN constexpr CTRE_FORCE_IN
9092
9193#if __cpp_nontype_template_parameter_class
9294template <ctll::basic_fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto search (std::string_view sv) noexcept {
93-
94- constexpr auto _input = input;
95+ constexpr auto _input = input; // workaround for GCC 9 bug 88092
9596 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
9697 static_assert (tmp (), " Regular Expression contains syntax error." );
9798 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
@@ -100,8 +101,8 @@ template <ctll::basic_fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLI
100101}
101102#else
102103template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto search (std::string_view sv) noexcept {
103-
104- using tmp = typename ctll::parser<ctre::pcre, input , ctre::pcre_actions>::template output<pcre_context<>>;
104+ constexpr auto & _input = input;
105+ using tmp = typename ctll::parser<ctre::pcre, _input , ctre::pcre_actions>::template output<pcre_context<>>;
105106 static_assert (tmp (), " Regular Expression contains syntax error." );
106107 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
107108 auto re_obj = ctre::regular_expression (re ());
@@ -112,7 +113,7 @@ template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto search(std
112113
113114#if __cpp_nontype_template_parameter_class
114115template <ctll::basic_fixed_string input, typename ForwardIt> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto search (ForwardIt first, ForwardIt last) noexcept {
115- constexpr auto _input = input;
116+ constexpr auto _input = input; // workaround for GCC 9 bug 88092
116117 using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
117118 static_assert (tmp (), " Regular Expression contains syntax error." );
118119 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
@@ -121,7 +122,7 @@ template <ctll::basic_fixed_string input, typename ForwardIt> CTRE_FLATTEN const
121122}
122123#else
123124template <auto & input, typename ForwardIt> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto search (ForwardIt first, ForwardIt last) noexcept {
124-
125+ constexpr auto & _input = input;
125126 using tmp = typename ctll::parser<ctre::pcre, input, ctre::pcre_actions>::template output<pcre_context<>>;
126127 static_assert (tmp (), " Regular Expression contains syntax error." );
127128 using re = decltype (ctll::front (typename tmp::output_type::stack_type ()));
0 commit comments