fork download
  1. #include <iostream>
  2.  
  3. const int c = 3;
  4.  
  5. struct A {
  6. static int f() { return ::c; }
  7. static const int c = 2;
  8. };
  9.  
  10. int main() {
  11. std::cout << A::f() << std::endl; // 2
  12. return 0;
  13. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
3