This is the mail archive of the gcc@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]

namelookup bug in gcc?


Hello all,

I have tested the following code on  g++ 4.3, 4.2, 4.1 and 3.4.

#include <iostream>

struct B {
  static const int x = 1;
};

struct A {
  static const int x = 0;
  template <typename A>
  static void f() {
    std::cerr << A::x << std::endl;
  }
};

int main() {
  A::f<B>();
  return 0;
}

The gcc result:
0
While icc, msvc result:
1

Best, Balazs

-------------------------------------------------------


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