From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhegulev@sigma.ispras.ru To: gcc-gnats@gcc.gnu.org Subject: c++/3009: Wrong name lookup in template Date: Wed, 30 May 2001 17:06:00 -0000 Message-id: <20010531000408.6000.qmail@sourceware.cygnus.com> X-SW-Source: 2001-05/msg01054.html List-Id: >Number: 3009 >Category: c++ >Synopsis: Wrong name lookup in template >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed May 30 17:06:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: zhegulev@sigma.ispras.ru >Release: 2.95.3 >Organization: >Environment: >Description: According to 14.6.2.4 of C++ Standard: "If a base class is a dependent type, a member of that class cannot hide a name declared within a template, or a name from the template's eclosing scopes." #include class B{ public: void foo(){cout << "B::foo"< class C :public T { public: void caller(){foo();} }; int main() { C c; c.caller(); return 0; } That example should print ::foo() But it prints B::foo >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="template16.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="template16.cc" I2luY2x1ZGUgPGlvc3RyZWFtLmg+CgpjbGFzcyBCewogcHVibGljOgogICB2b2lkIGZvbygpe2Nv dXQgPDwgIkI6OmZvbyI8PGVuZGw7fQp9OwoKdm9pZCBmb28oKQp7IGNvdXQgPDwgIjo6Zm9vKCki PDxlbmRsO30KCnRlbXBsYXRlIDxjbGFzcyBUPgpjbGFzcyBDIDpwdWJsaWMgVAp7CiBwdWJsaWM6 CiAgIHZvaWQgY2FsbGVyKCl7Zm9vKCk7fQp9OwoKCmludCBtYWluKCkKewogIEM8Qj4gYzsKICBj LmNhbGxlcigpOwogIHJldHVybiAwOwp9Cg==