This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14278] [3.4/3.5 Regression] fails when calling through a function pointer


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]