public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13829] New: typedef of function type handled incorrectly when used as template argument
@ 2004-01-23 10:22 heinlein at informatik dot uni-ulm dot de
2004-01-23 11:41 ` [Bug c++/13829] " giovannibajo at libero dot it
0 siblings, 1 reply; 2+ messages in thread
From: heinlein at informatik dot uni-ulm dot de @ 2004-01-23 10:22 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/13829] typedef of function type handled incorrectly when used as template argument
2004-01-23 10:22 [Bug c++/13829] New: typedef of function type handled incorrectly when used as template argument heinlein at informatik dot uni-ulm dot de
@ 2004-01-23 11:41 ` giovannibajo at libero dot it
0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-23 11:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-23 11:41 -------
Not a bug. [temp.arg.type]/3: "If a declaration acquires a function type
through a type dependent on a template-parameter and this causes a declaration
that does not use the syntactic form of a function declarator to have function
type, the program is ill-formed."
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13829
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-23 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-23 10:22 [Bug c++/13829] New: typedef of function type handled incorrectly when used as template argument heinlein at informatik dot uni-ulm dot de
2004-01-23 11:41 ` [Bug c++/13829] " giovannibajo at libero dot it
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).