Bug 9261 - [3.2 regression] Internal compiler error in arg_assoc, at cp/decl2.c:4793
Summary: [3.2 regression] Internal compiler error in arg_assoc, at cp/decl2.c:4793
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-invalid-code
Depends on:
Reported: 2003-01-10 07:26 UTC by pommier
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description pommier 2003-01-10 07:26:01 UTC
The following (invalid) code:
#include <iostream>
#include <typeinfo>
struct A {
  virtual void f() {}

int main() {
  A* p;
  std::cerr << typeid(*p).name;

crashes g++ 3.2, g++ 3.2.1 (and also g++ 3.0) with this message:
t.C: In function `int main()':
t.C:9: Internal compiler error in arg_assoc, at cp/decl2.c:4809

it may be related to the (closed) bugreport #3416 for a crash of g++ 3.0 at the same place.

3.2 , 3.2.1

Debian 3.0 Linux 2.4.18 i686 unknown / g++ (GCC) 3.2.1
OSF1 V4.0 1229 alpha / g++ (GCC) 3.2
Comment 1 Wolfgang Bangerth 2003-01-10 07:43:50 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed on the 3.2 branch. It's a regression w.r.t. 2.95,
    but is fixed on 3.3 and 3.4, which now give
    tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
    x.cc: In function `int main()':
    x.cc:9: error: request for member `std::type_info::name() const' in `
       __cxa_bad_typeid()()', which is of non-class type `const std::type_info&'
    The message is not exactly obvious, but once you think
    about it, it's right.
Comment 2 Wolfgang Bangerth 2003-01-10 09:59:15 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <pommier@gmm.insa-tlse.fr>
Subject: Re: c++/9261: [3.2 regression] Internal compiler error in arg_assoc,
 at cp/decl2.c:4793
Date: Fri, 10 Jan 2003 09:59:15 -0600 (CST)

 In case someone wants to move a possible fixing patch from the mainline to 
 the 3.2 branch: the problem was fixed on mainline sometime between
 2002-08-15 and 2002-09-01. However, it should be noted that the ICE moved 
 before it was fixed, which might indicate that it would not be a single 
 small patch to fix it. Here's the places where the ICE occurs:
 2001-01-01 through 2002-08-01: arg_assoc, at cp/decl2.c:4903
 2002-08-15                   : resolve_overloaded_unification, at cp/pt.c:8249
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
Comment 3 Joe Buck 2003-04-25 20:17:44 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.