https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87061

            Bug ID: 87061
           Summary: [9 Regression] regex cannot be compiled with
                    -std=c++1z -D_GLIBCXX_USE_CXX11_ABI=0
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

Using the regex header (like in the code snippet below) with the the options
"-std=c++1z -D_GLIBCXX_USE_CXX11_ABI=0" results in an error message.

This is a regression introduced between 2018-07-26 and 2018-08-17.

===================================
#include <regex>
===================================

In file included from /gcc-9/include/c++/9.0.0/string:52,
                 from /gcc-9/include/c++/9.0.0/bitset:47,
                 from /gcc-9/include/c++/9.0.0/regex:39,
                 from bug.cc:1:
/gcc-9/include/c++/9.0.0/bits/basic_string.h: In instantiation of 'class
std::basic_string<char, std::char_traits<char>,
std::pmr::polymorphic_allocator<char> >':
/gcc-9/include/c++/9.0.0/regex:77:41:   required from here
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3103:63: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
3103 |       typedef typename _Alloc::template rebind<_CharT>::other
_CharT_alloc_type;
     |                                                              
^~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3116:68: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
3116 |       typedef __gnu_cxx::__normal_iterator<pointer, basic_string> 
iterator;
     |                                                                   
^~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3118:61: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
3118 |                                                            
const_iterator;
     |                                                            
^~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3119:53: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
3119 |       typedef std::reverse_iterator<const_iterator>
const_reverse_iterator;
     |                                                    
^~~~~~~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3120:52: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
3120 |       typedef std::reverse_iterator<iterator>      reverse_iterator;
     |                                                    ^~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5233:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5233 |  find(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5311:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5311 |  rfind(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5395:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5395 |  find_first_of(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5479:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5479 |  find_last_of(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5560:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5560 |  find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5642:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<char>'
5642 |  find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~~~~~~~~~~~~
In file included from bug.cc:3:
/gcc-9/include/c++/9.0.0/regex:77:57: error: template argument 1 is invalid
77 |     using smatch  = match_results<string::const_iterator>;
   |                                                         ^
In file included from /gcc-9/include/c++/9.0.0/string:52,
                 from /gcc-9/include/c++/9.0.0/bitset:47,
                 from /gcc-9/include/c++/9.0.0/regex:39,
                 from bug.cc:1:
/gcc-9/include/c++/9.0.0/bits/basic_string.h: In instantiation of 'class
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::pmr::polymorphic_allocator<wchar_t> >':
/gcc-9/include/c++/9.0.0/regex:80:42:   required from here
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3103:63: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
3103 |       typedef typename _Alloc::template rebind<_CharT>::other
_CharT_alloc_type;
     |                                                              
^~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3116:68: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
3116 |       typedef __gnu_cxx::__normal_iterator<pointer, basic_string> 
iterator;
     |                                                                   
^~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3118:61: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
3118 |                                                            
const_iterator;
     |                                                            
^~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3119:53: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
3119 |       typedef std::reverse_iterator<const_iterator>
const_reverse_iterator;
     |                                                    
^~~~~~~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:3120:52: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
3120 |       typedef std::reverse_iterator<iterator>      reverse_iterator;
     |                                                    ^~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5233:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5233 |  find(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5311:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5311 |  rfind(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5395:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5395 |  find_first_of(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5479:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5479 |  find_last_of(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5560:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5560 |  find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
     |  ^~~~~~~~~~~~~~~~~
/gcc-9/include/c++/9.0.0/bits/basic_string.h:5642:2: error: no class template
named 'rebind' in 'class std::pmr::polymorphic_allocator<wchar_t>'
5642 |  find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
     |  ^~~~~~~~~~~~~~~~
In file included from bug.cc:3:
/gcc-9/include/c++/9.0.0/regex:80:58: error: template argument 1 is invalid
80 |     using wsmatch = match_results<wstring::const_iterator>;
   |                                                          ^

Reply via email to