public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators
@ 2015-01-17 21:11 redi at gcc dot gnu.org
  2015-01-17 21:17 ` [Bug libstdc++/64649] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-17 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64649
           Summary: regex_traits::lookup_classname() only works with
                    random access iterators
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

#include <regex>
#include <forward_list>

int main()
{
  std::forward_list<char> f{ 'A' };
  std::regex_traits<char>{}.lookup_collatename(f.begin(), f.end());
}

This function should work with ForwardIterators, but it fails because of line
300 in bits/regex.tcc

      std::string __s(__last - __first, '?');


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
@ 2015-01-17 21:17 ` redi at gcc dot gnu.org
  2015-01-19 23:00 ` timshen at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-17 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-17
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Actually it's even worse than that, the next line will only work with pointers
and not even arbitrary random access iterators:

      __fctyp.narrow(__first, __last, '?', &*__s.begin());

The signature of ctype<charT>::narrow is

  const charT*
  ctype<charT>::narrow(const charT*, const charT*, char, char*) const;

So __first and __last are not acceptable arguments.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
  2015-01-17 21:17 ` [Bug libstdc++/64649] " redi at gcc dot gnu.org
@ 2015-01-19 23:00 ` timshen at gcc dot gnu.org
  2015-01-19 23:13 ` timshen at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-01-19 23:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tim Shen <timshen at gcc dot gnu.org> ---
Author: timshen
Date: Mon Jan 19 23:00:13 2015
New Revision: 219866

URL: https://gcc.gnu.org/viewcvs?rev=219866&root=gcc&view=rev
Log:
    PR libstdc++/64649
    * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
    regex_traits<>::lookup_classname): Support forward iterators.
    * testsuite/28_regex/traits/char/lookup_classname.cc: New testcases.
    * testsuite/28_regex/traits/char/lookup_collatename.cc: New testcase.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/regex.tcc
    trunk/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc
    trunk/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
  2015-01-17 21:17 ` [Bug libstdc++/64649] " redi at gcc dot gnu.org
  2015-01-19 23:00 ` timshen at gcc dot gnu.org
@ 2015-01-19 23:13 ` timshen at gcc dot gnu.org
  2015-01-22  5:03 ` timshen at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-01-19 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tim Shen <timshen at gcc dot gnu.org> ---
Author: timshen
Date: Mon Jan 19 23:12:37 2015
New Revision: 219869

URL: https://gcc.gnu.org/viewcvs?rev=219869&root=gcc&view=rev
Log:
    PR libstdc++/64649
    Backported from mainline
    2015-01-19  Tim Shen  <timshen@google.com>

    * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
    regex_traits<>::lookup_classname): Support forward iterators.
    * testsuite/28_regex/traits/char/lookup_classname.cc: New testcases.
    * testsuite/28_regex/traits/char/lookup_collatename.cc: New testcase.

Modified:
    branches/gcc-4_9-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_9-branch/libstdc++-v3/include/bits/regex.tcc
   
branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc
   
branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-01-19 23:13 ` timshen at gcc dot gnu.org
@ 2015-01-22  5:03 ` timshen at gcc dot gnu.org
  2015-02-03  9:00 ` timshen at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-01-22  5:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tim Shen <timshen at gcc dot gnu.org> ---
Author: timshen
Date: Thu Jan 22 05:02:38 2015
New Revision: 219986

URL: https://gcc.gnu.org/viewcvs?rev=219986&root=gcc&view=rev
Log:
    PR libstdc++/64649
    * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
    regex_traits<>::lookup_classname): Correctly narrow input chars.
    * testsuite/28_regex/traits/wchar_t/user_defined.cc: New testcase.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/regex.tcc
    trunk/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-01-22  5:03 ` timshen at gcc dot gnu.org
@ 2015-02-03  9:00 ` timshen at gcc dot gnu.org
  2015-03-09  6:53 ` timshen at gcc dot gnu.org
  2023-07-20 11:45 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-02-03  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tim Shen <timshen at gcc dot gnu.org> ---
Author: timshen
Date: Tue Feb  3 08:59:24 2015
New Revision: 220365

URL: https://gcc.gnu.org/viewcvs?rev=220365&root=gcc&view=rev
Log:
    PR libstdc++/64649
    Backported from mainline
    2015-01-22  Tim Shen  <timshen@google.com>

    * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
    regex_traits<>::lookup_classname): Correctly narrow input chars.
    * testsuite/28_regex/traits/wchar_t/user_defined.cc: New testcase.

Modified:
    branches/gcc-4_9-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_9-branch/libstdc++-v3/include/bits/regex.tcc
   
branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-02-03  9:00 ` timshen at gcc dot gnu.org
@ 2015-03-09  6:53 ` timshen at gcc dot gnu.org
  2023-07-20 11:45 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: timshen at gcc dot gnu.org @ 2015-03-09  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

Tim Shen <timshen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |timshen at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #6 from Tim Shen <timshen at gcc dot gnu.org> ---
Resolved.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/64649] regex_traits::lookup_classname() only works with random access iterators
  2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-03-09  6:53 ` timshen at gcc dot gnu.org
@ 2023-07-20 11:45 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-20 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-20 11:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-17 21:11 [Bug libstdc++/64649] New: regex_traits::lookup_classname() only works with random access iterators redi at gcc dot gnu.org
2015-01-17 21:17 ` [Bug libstdc++/64649] " redi at gcc dot gnu.org
2015-01-19 23:00 ` timshen at gcc dot gnu.org
2015-01-19 23:13 ` timshen at gcc dot gnu.org
2015-01-22  5:03 ` timshen at gcc dot gnu.org
2015-02-03  9:00 ` timshen at gcc dot gnu.org
2015-03-09  6:53 ` timshen at gcc dot gnu.org
2023-07-20 11:45 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).