public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17359] New: Can't convert function pointer
@ 2004-09-08 21:03 bangerth at dealii dot org
2004-09-09 6:52 ` [Bug c++/17359] " simartin at users dot sourceforge dot net
2004-09-09 10:01 ` giovannibajo at libero dot it
0 siblings, 2 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-09-08 21:03 UTC (permalink / raw)
To: gcc-bugs
[Taken from http://gcc.gnu.org/ml/gcc/2004-09/msg00389.html]
We can't compile this:
----------------------
class B {};
struct D : public B {
template <int> void foo();
};
typedef void (B::*BfooPtr)();
typedef void (D::*fooPtr)();
void bar () {
static_cast<BfooPtr>(&D::foo<1>);
static_cast<BfooPtr>((fooPtr)&D::foo<1>);
}
----------------------------
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc: In function `void bar()':
x.cc:11: error: invalid static_cast from type `<unknown type>' to type `void
(B::*)()'
Note that the first line with the static_cast fails, whereas the second one
succeeds. This is wrong, since the cast in the second line only casts the
member function pointer to exactly its type as before.
gcc is also wrong, since the same code succeeds when foo() is not a template,
and finally the error message with <unknown type> is really unhelpful: after
all we completely resolved the overload set to a single function by
specifying the template argument.
W.
--
Summary: Can't convert function pointer
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
2004-09-08 21:03 [Bug c++/17359] New: Can't convert function pointer bangerth at dealii dot org
@ 2004-09-09 6:52 ` simartin at users dot sourceforge dot net
2004-09-09 10:01 ` giovannibajo at libero dot it
1 sibling, 0 replies; 7+ messages in thread
From: simartin at users dot sourceforge dot net @ 2004-09-09 6:52 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |simartin at users dot
| |sourceforge dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
2004-09-08 21:03 [Bug c++/17359] New: Can't convert function pointer bangerth at dealii dot org
2004-09-09 6:52 ` [Bug c++/17359] " simartin at users dot sourceforge dot net
@ 2004-09-09 10:01 ` giovannibajo at libero dot it
1 sibling, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-09 10:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-09-09 10:01 -------
Confirmed, not a regression.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |2.95.3 3.0.4 3.2.3 3.3.3
| |3.4.0 3.5.0
Last reconfirmed|0000-00-00 00:00:00 |2004-09-09 10:01:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
[not found] <bug-17359-102@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2009-04-16 18:07 ` pinskia at gcc dot gnu dot org
@ 2009-12-26 12:44 ` paolo dot carlini at oracle dot com
3 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-26 12:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from paolo dot carlini at oracle dot com 2009-12-26 12:43 -------
Works in mainline, not a regression, closing.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work| |4.5.0
Resolution| |WORKSFORME
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
[not found] <bug-17359-102@http.gcc.gnu.org/bugzilla/>
2006-09-25 19:38 ` pinskia at gcc dot gnu dot org
2007-01-21 5:23 ` bangerth at dealii dot org
@ 2009-04-16 18:07 ` pinskia at gcc dot gnu dot org
2009-12-26 12:44 ` paolo dot carlini at oracle dot com
3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 18:07 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 583 bytes --]
------- Comment #4 from pinskia at gcc dot gnu dot org 2009-04-16 18:06 -------
t.cc: In function void bar():
t.cc:11: error: invalid static_cast from type <unresolved overloaded function
type> to type void (B::*)()
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-05-01 03:45:12 |2009-04-16 18:06:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
[not found] <bug-17359-102@http.gcc.gnu.org/bugzilla/>
2006-09-25 19:38 ` pinskia at gcc dot gnu dot org
@ 2007-01-21 5:23 ` bangerth at dealii dot org
2009-04-16 18:07 ` pinskia at gcc dot gnu dot org
2009-12-26 12:44 ` paolo dot carlini at oracle dot com
3 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2007-01-21 5:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from bangerth at dealii dot org 2007-01-21 05:23 -------
*** Bug 30281 has been marked as a duplicate of this bug. ***
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/17359] Can't convert function pointer
[not found] <bug-17359-102@http.gcc.gnu.org/bugzilla/>
@ 2006-09-25 19:38 ` pinskia at gcc dot gnu dot org
2007-01-21 5:23 ` bangerth at dealii dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-25 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-09-25 19:38 -------
This looks like a duplicated of PR 11407.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17359
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-26 12:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-08 21:03 [Bug c++/17359] New: Can't convert function pointer bangerth at dealii dot org
2004-09-09 6:52 ` [Bug c++/17359] " simartin at users dot sourceforge dot net
2004-09-09 10:01 ` giovannibajo at libero dot it
[not found] <bug-17359-102@http.gcc.gnu.org/bugzilla/>
2006-09-25 19:38 ` pinskia at gcc dot gnu dot org
2007-01-21 5:23 ` bangerth at dealii dot org
2009-04-16 18:07 ` pinskia at gcc dot gnu dot org
2009-12-26 12:44 ` paolo dot carlini at oracle dot com
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).