This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14278] [3.4/3.5 Regression] fails when calling through a function pointer
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2004 20:20:08 -0000
- Subject: [Bug c++/14278] [3.4/3.5 Regression] fails when calling through a function pointer
- References: <20040224185813.14278.jbrandmeyer@earthlink.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-02-24 20:20 -------
OK, this is the cleanest I can come up with:
----------------
struct X {
X(int p);
};
struct A {
A(X);
};
void *p_fun;
A a(X ((*(int (*)(int, int)) p_fun)(0, 0)));
--------------------
I think the code is valid. It fails with 3.4 and mainline, though,
while it compiles with 3.3.4:
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:10: error: expected `)' before "p_fun"
x.cc:10: error: expected `)' before "p_fun"
x.cc:10: error: expected `,' or `...' before "p_fun"
x.cc:10: error: function `A a(X)' is initialized like a variable
x.cc:10: error: expected `,' or `;' before ')' token
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc:10: error: expected `)' before "p_fun"
x.cc:10: error: expected `)' before "p_fun"
x.cc:10: error: expected `,' or `...' before "p_fun"
x.cc:10: error: function `A a(X)' is initialized like a variable
x.cc:10: error: expected `,' or `;' before ')' token
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.4.0 3.5.0
Known to work| |3.3.4
Last reconfirmed|0000-00-00 00:00:00 |2004-02-24 20:20:07
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14278