c++/9309: [3.4 regression][New parser] ICE with function-pointer-type template arguments
bangerth@ticam.utexas.edu
bangerth@ticam.utexas.edu
Tue Jan 14 16:01:00 GMT 2003
>Number: 9309
>Category: c++
>Synopsis: [3.4 regression][New parser] ICE with function-pointer-type template arguments
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Tue Jan 14 07:56:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
3.4 after parser merge
>Description:
I suspect that this code is illegal, since the template
keyword for disambiguation is not allowed here:
----------------------------
struct CPU {
typedef int (*pfun)();
template <pfun step1>
static int dispatch();
};
template<int>
static int foo();
template int CPU::dispatch<&template foo<2> > ();
------------------------
Nevertheless, it should not ICE, which it started
within the last three weeks, probably with the new parser:
tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -c y.cc
y.cc:11: error: parse error before `template'
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c y.cc
y.cc:11: error: template-id `dispatch<<expression error> >' used as a
declarator
y.cc:11: internal compiler error: Speicherzugriffsfehler
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:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list