Bug 208837 - Internal compiler error in GCC C++ 4.1.1
Internal compiler error in GCC C++ 4.1.1
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
5
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-02 07:00 EDT by Seppo Enarvi
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-02 07:23:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Preprocessed source (550.29 KB, text/plain)
2006-10-02 07:00 EDT, Seppo Enarvi
no flags Details

  None (edit)
Description Seppo Enarvi 2006-10-02 07:00:40 EDT
Description of problem:

A template function like this:

 template <typename OutputIterator>
 void get_string_values(
  const string_vector_map & m,
  const std::string & x,
  OutputIterator out)
 {
  typedef string_vector_map::const_iterator iterator;
  std::pair<iterator, iterator> range =
   m.equal_range(x);
  for (iterator i = range.first; i != range.second; ++i) {
   string_vector_map::mapped_type & value = i->second;
   *out++ = string(value.begin(), value.end());
  }
 }

(that is supposed to write the values of multimap m whose key is x to an output
iterator), causes an internal compiler error at the line:

   *out++ = string(value.begin(), value.end());


Version-Release number of selected component (if applicable):

c++ (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)


How reproducible:

gcc main.cc

  
Actual results:

internal compiler error: in type_dependent_expression_p, at cp/pt.c:12732


Additional info:

The preprocessed source is attached to this bugreport.
Comment 1 Seppo Enarvi 2006-10-02 07:00:41 EDT
Created attachment 137534 [details]
Preprocessed source
Comment 2 Seppo Enarvi 2006-10-02 07:17:03 EDT
(In reply to comment #0)
>    *out++ = string(value.begin(), value.end());

The error disappears, if string is correctly qualified here (std::string).
Comment 3 Jakub Jelinek 2006-10-02 07:23:32 EDT
You need to add scope (i.e. std::string rather than string).
See http://gcc.gnu.org/PR28705 for details.
As this is an ice-on-invalid, I'm not going to diverge from upstream
gcc-4_1-branch on this.

Note You need to log in before you can comment on or make changes to this bug.