This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13829] New: typedef of function type handled incorrectly when used as template argument
- From: "heinlein at informatik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2004 10:22:07 -0000
- Subject: [Bug c++/13829] New: typedef of function type handled incorrectly when used as template argument
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Below, using the typedef name F to declare a member function f of struct X
works correctly.
When F is passed as a template argument to struct Y, however,
the corresponding declaration of f is rejected.
ixtys$ uname -a
Linux ixtys 2.2.18 #1 Fri Jan 19 22:10:35 GMT 2001 i686 unknown
ixtys$ g++ -v
Reading specs from
/home/heinlein/soft/GCC/3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/home/heinlein/soft/GCC/3.2
Thread model: posix
gcc version 3.2
ixtys$ g++ -c bug.cxx -save-temps
bug.cxx: In instantiation of `Y<int ()()>':
bug.cxx:13: instantiated from here
bug.cxx:9: field `Y<int ()()>::f' invalidly declared function type
ixtys$ cat bug.ii
# 1 "bug.cxx"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "bug.cxx"
typedef int F ();
struct X {
F f;
};
template <typename T>
struct Y {
T f;
};
X x;
Y<F> y;
--
Summary: typedef of function type handled incorrectly when used
as template argument
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: heinlein at informatik dot uni-ulm dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13829