This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8999: SegFault after illegal template declaration


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]