This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 3.0.1: uninitialized int != 0
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ 3.0.1: uninitialized int != 0
- From: Markus Werle <numerical dot simulation at web dot de>
- Date: Wed, 22 Aug 2001 11:04:17 +0200
The integer k below does not default to zero with gcc-3.0.1
(Monday's version)
With gcc-3.0 this code here is OK.
#include <iostream>
using namespace std;
int g(int j) {
cout << "standalone: " << j << endl;
return j;
}
struct C;
typedef int (* FunctionPointer)(int);
struct C {
template <FunctionPointer FP> int f(int j) {
cout << "calling FP " << j << endl;
return FP(j);
}
};
int main() {
C c;
int k;
int j = c.f<&g>(k);
}