Bug 114634 - g++ fails with "Internal compiler error in arg_assoc, at cp/decl2.c:4811"
g++ fails with "Internal compiler error in arg_assoc, at cp/decl2.c:4811"
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
9
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-30 09:26 EST by Kim Karlsson
Modified: 2007-04-18 13:02 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-04 15:29:24 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)

  None (edit)
Description Kim Karlsson 2004-01-30 09:26:28 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
The following code gives the error:
src/error.cpp: In function `int main()':
src/error.cpp:21: Internal compiler error in arg_assoc, at cp/decl2.c:4811

Granted, the code is broken (missing parenthesises), but it sounds
serious that it kills the compiler with internal error.
----
#include <iostream>

using namespace std;

class A {
  string d_Name;
public:
  string name() { return( d_Name ); };
  void setName( string s ) { d_Name = s; };
};

int main()
{
  A a, b;
  string s;
  
  a.setName( "I'm A" );
  b.setName( "I'm B" );
  int ia = 0, ib = 1;
  
  // next line gives error, using a.name() : b.name() will fix
  s = ( ia < ib ) ? a.name : b.name; 
  
  cout << s << endl;
}


Version-Release number of selected component (if applicable):
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

How reproducible:
Always

Steps to Reproduce:
1. Just compile with: g++ -Wall -Wno-deprecated
2.
3.
    

Actual Results:  I get this:

src/error.cpp: In function `int main()':
src/error.cpp:22: Internal compiler error in arg_assoc, at cp/decl2.c:4811
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  Anything but an internal error...

Additional info:
Comment 1 Richard Henderson 2004-10-04 15:29:24 EDT
Fixed in gcc 3.4, which yields

z.c:22: error: no match for 'operator=' in 's = ((ia < ib) ? a.A::name
: b.A::name)'

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