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]

g++ 3.0.1: uninitialized int != 0


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);
}


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