------- Comment #1 from b0ntrict0r at yandex dot ru 2009-08-07 18:11 ------- By the way using gcc instead of g++ doesn't changed things.
And I've just tested this code with Comeau online C++ compiler and it gave exactly what I want to get: Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2 Copyright 1988-2008 Comeau Computing. All rights reserved. BD Software STL Message Decryptor (Release 1.24 for Comeau C++) MODE:strict errors C++ C++0x_extensions ComeauTest.c(15): error: "number" has already been declared in the current scope int number; ^ ComeauTest.c(22): error: member "testclass::number" (declared at line 15) is inaccessible (void)ts.number(); ^ ComeauTest.c(22): error: expression must have (pointer-to-) function type (void)ts.number(); ^ 3 errors detected in the compilation of "ComeauTest.c". -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41002