This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8999: SegFault after illegal template declaration
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 18 Dec 2002 23:12:59 -0000
- Subject: c++/8999: SegFault after illegal template declaration
- Reply-to: bangerth at ticam dot utexas dot edu
>Number: 8999
>Category: c++
>Synopsis: SegFault after illegal template declaration
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Wed Dec 18 15:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 3.3 CVS of last week
>Description:
While loosing overview of a small template metaprogramming
project, I happened to write something like
--------------------------------
template <typename ST, T> struct X {};
int main () {};
--------------------------------
The second template parameter of X is incorrectly given.
This crashes the compiler:
tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c y.cc
y.cc:1: error: parse error before `>' token
y.cc:3: error: cannot declare `::main' to be a template
y.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
>Fix:
Write correct code.
>Release-Note:
>Audit-Trail:
>Unformatted: