Bug 114634

Summary: g++ fails with "Internal compiler error in arg_assoc, at cp/decl2.c:4811"
Product: [Retired] Red Hat Linux Reporter: Kim Karlsson <kim.karlsson>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-04 19:29:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kim Karlsson 2004-01-30 14:26:28 UTC
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 19:29:24 UTC
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)'