This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/5921: ICE with static variable
- From: reichelt at igpm dot rwth-aachen dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 12 Mar 2002 13:56:40 -0000
- Subject: c++/5921: ICE with static variable
- Reply-to: reichelt at igpm dot rwth-aachen dot de
>Number: 5921
>Category: c++
>Synopsis: ICE with static variable
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Tue Mar 12 06:06:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Volker Reichelt
>Release: gcc version 3.1 20020304 (prerelease)
>Organization:
>Environment:
mips-sgi-irix6.5, i686-pc-linux-gnu
>Description:
The following code snippet causes an ICE when compiled
with gcc 3.1. It's a regression vs. gcc 3.0.x.
----------------------snip here------------------
struct A
{
struct B { B(); };
};
static A::B b;
inline template <int i> void f ();
----------------------snip here------------------
The error message is:
bug.cpp:8: parse error before `<' token
bug.cpp:6: definition provided for explicit instantiation
bug.cpp:6: non-template used as template
bug.cpp:6: internal error: Segmentation fault
Please submit a full bug report, [etc.]
The example above is very similar to PR 5624. It looks
as if both show different symptoms of the same bug.
Maybe the patch for PR 5624 that cured one symptom
gets superfluous, once the underlying real bug is fixed.
Therefore, IMHO, PR 5624 should be revisited, too.
Since a similar static declaration occurs in iostream
(A == ios_base and B == Init), the bug might affect
quite a number of programs.
>How-To-Repeat:
g++ -c bug.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: