From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25617 invoked by alias); 24 Oct 2008 14:10:01 -0000 Received: (qmail 14840 invoked by uid 48); 24 Oct 2008 14:08:36 -0000 Date: Fri, 24 Oct 2008 14:10:00 -0000 Subject: [Bug c++/37910] New: Must use 'this' to access member X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "lyricsfan at lycos dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01595.txt.bz2 g++ 4.3.2 linux 2.6.11.7 (gentoo) Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.3.2/configure --prefix= Thread model: posix gcc version 4.3.2 (GCC) g++ test.cpp Error when condition detailed at the end is met: test.cpp: In constructor 'Y::Y()': test.cpp:5: error: 'i' was not declared in this scope test.ii # 1 "test.cpp" # 1 "" # 1 "" # 1 "test.cpp" template struct X { int i; }; template struct Y : public X { Y() { i = 100; } }; int main() { Y y; } test.s .file "test.cpp" *** The above code does not correctly compile if 'this->' is removed ('double' and 'int' are dummy types), while g++ 3.3.6 works as expected. Also not working: g++ 3.4.6 (no other version tried). -- Summary: Must use 'this' to access member Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lyricsfan at lycos dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37910