From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7007 invoked by alias); 14 Nov 2011 17:57:23 -0000 Received: (qmail 6990 invoked by uid 22791); 14 Nov 2011 17:57:22 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_FN X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Nov 2011 17:57:08 +0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/30195] Using declaration doesn't work in template. Date: Mon, 14 Nov 2011 17:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: fabien at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-11/txt/msg01418.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30195 --- Comment #5 from Jason Merrill 2011-11-14 17:56:04 UTC --- Author: jason Date: Mon Nov 14 17:55:57 2011 New Revision: 181359 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181359 Log: PR c++/6936 PR c++/25994 PR c++/26256 PR c++/30195 * search.c (lookup_field_1): Look through USING_DECL. (lookup_field_r): Call lookup_fnfields_slot instead of lookup_fnfields_1. * semantics.c (finish_member_declaration): Remove the check that prevents USING_DECLs from being verified by pushdecl_class_level. Call add_method for using declarations that designates functions if the using declaration is in a template class. Set DECL_IGNORED_P on class-scope using declarations. * typeck.c (build_class_member_access_expr): Handle USING_DECLs. * class.c (check_field_decls): Keep using declarations. (add_method): Remove two diagnostics about conflicting using declarations. * parser.c (cp_parser_nonclass_name): Handle USING_DECLs. * decl.c (start_enum): Call xref_tag whenever possible. * cp-tree.h (strip_using_decl): Declare, and reident the previous function. * name-lookup.c (strip_using_decl): New function. (supplement_binding_1): Call strip_using_decl on decl and bval. Perform most of the checks with USING_DECLs stripped. Also check that the target decl and the target bval does not refer to the same declaration. Allow pushing an enum multiple times in a template class. Adjustment to diagnose using redeclarations. Call diagnose_name_conflict. (push_class_level_binding): Call strip_using_decl on decl and bval. Perform most of the checks with USING_DECLs stripped. Return true if both decl and bval refer to USING_DECLs and are dependent. (diagnose_name_conflict): New function. Added: trunk/gcc/testsuite/g++.dg/cpp0x/forw_enum10.C trunk/gcc/testsuite/g++.dg/debug/using4.C trunk/gcc/testsuite/g++.dg/debug/using5.C trunk/gcc/testsuite/g++.dg/lookup/pr6936.C trunk/gcc/testsuite/g++.dg/lookup/using24.C trunk/gcc/testsuite/g++.dg/lookup/using25.C trunk/gcc/testsuite/g++.dg/lookup/using26.C trunk/gcc/testsuite/g++.dg/lookup/using27.C trunk/gcc/testsuite/g++.dg/lookup/using28.C trunk/gcc/testsuite/g++.dg/lookup/using29.C trunk/gcc/testsuite/g++.dg/lookup/using30.C trunk/gcc/testsuite/g++.dg/lookup/using31.C trunk/gcc/testsuite/g++.dg/lookup/using32.C trunk/gcc/testsuite/g++.dg/lookup/using33.C trunk/gcc/testsuite/g++.dg/lookup/using34.C trunk/gcc/testsuite/g++.dg/lookup/using35.C trunk/gcc/testsuite/g++.dg/lookup/using36.C trunk/gcc/testsuite/g++.dg/lookup/using37.C trunk/gcc/testsuite/g++.dg/lookup/using38.C trunk/gcc/testsuite/g++.dg/lookup/using39.C trunk/gcc/testsuite/g++.dg/lookup/using40.C trunk/gcc/testsuite/g++.dg/lookup/using41.C trunk/gcc/testsuite/g++.dg/lookup/using42.C trunk/gcc/testsuite/g++.dg/lookup/using44.C trunk/gcc/testsuite/g++.dg/lookup/using45.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/name-lookup.c trunk/gcc/cp/parser.c trunk/gcc/cp/search.c trunk/gcc/cp/semantics.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/abi/mangle41.C trunk/gcc/testsuite/g++.dg/inherit/using4.C trunk/gcc/testsuite/g++.dg/lookup/name-clash9.C trunk/gcc/testsuite/g++.dg/parse/ctor5.C trunk/gcc/testsuite/g++.dg/template/static4.C trunk/gcc/testsuite/g++.dg/template/typedef1.C trunk/gcc/testsuite/g++.dg/template/using2.C trunk/gcc/testsuite/g++.old-deja/g++.brendan/misc14.C trunk/gcc/testsuite/g++.old-deja/g++.bugs/900127_02.C trunk/gcc/testsuite/g++.old-deja/g++.jason/scoping16.C trunk/gcc/testsuite/g++.old-deja/g++.other/anon7.C trunk/gcc/testsuite/g++.old-deja/g++.other/redecl1.C trunk/gcc/testsuite/g++.old-deja/g++.other/typedef7.C trunk/gcc/testsuite/g++.old-deja/g++.other/using1.C