c++/9341: [3.4 regression] Specialization after use gives error
rguenth@tat.physik.uni-tuebingen.de
rguenth@tat.physik.uni-tuebingen.de
Thu Jan 16 10:46:00 GMT 2003
>Number: 9341
>Category: c++
>Synopsis: [3.4 regression] Specialization after use gives error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Jan 16 02:46:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Richard Guenther
>Release: g++ (GCC) 3.4 20030115 (experimental)
>Organization:
>Environment:
ix86-linux
>Description:
template<class T, class U>
struct UnaryReturn {
typedef T Type_t;
};
struct foo
{
template <class T>
typename UnaryReturn<T, int>::Type_t foo();
};
template<class T>
struct UnaryReturn<T, int> {
typedef bool Type_t;
};
gives
bellatrix:~/src/tests$ ~/ix86/gcc3.4/bin/g++ -c -Wall insbefdecl.cpp
insbefdecl.cpp:8: error: return type specification for constructor invalid
insbefdecl.cpp:11: error: specialization of `UnaryReturn<T, int>' after instantiation
>From Mark Mitchell:
This is a bug -- but not in the new parser. This is lingering fallout from the now-almost-gone implicit typename extension. I will use this as the excuse to kill the last vestiges of that ugliness.
>How-To-Repeat:
compile the testcase with the new parser
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list