From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6789 invoked by alias); 17 Jul 2012 14:11:07 -0000 Received: (qmail 6772 invoked by uid 22791); 17 Jul 2012 14:11:06 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_CX,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 14:10:26 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6HEAQ5b020127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Jul 2012 10:10:26 -0400 Received: from [10.3.113.11] ([10.3.113.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6HEAPwh001667; Tue, 17 Jul 2012 10:10:25 -0400 Message-ID: <50057250.9080902@redhat.com> Date: Tue, 17 Jul 2012 14:11:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Paolo Carlini CC: "gcc-patches@gcc.gnu.org" , Dodji Seketeli Subject: Re: [C++ RFC / Patch] PR 51213 ("access control under SFINAE") References: <4FDB4640.3050502@oracle.com> <4FFF55EF.3090508@redhat.com> <500141D9.6010808@oracle.com> <500451CB.5040903@redhat.com> <50055E76.8030500@oracle.com> In-Reply-To: <50055E76.8030500@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg00742.txt.bz2 On 07/17/2012 08:45 AM, Paolo Carlini wrote: > -check_default_argument (tree decl, tree arg) > +check_default_argument (tree decl, tree arg, tsubst_flags_t complain) Hmm, I don't think substitution of default arguments can cause deduction failure; it happens after we've chosen which function to call. What was the motivation for the default argument changes? > + tmp = error_mark_node; Let's use a more informative name than "tmp" for these flags. > -void > -perform_deferred_access_checks (void) > +bool > +perform_deferred_access_checks (tsubst_flags_t complain) Need to document what the return value means. > - if (complain & tf_error) > - perform_or_defer_access_check (TYPE_BINFO (context), t, t); > > + if (!perform_or_defer_access_check (TYPE_BINFO (context), t, t, complain)) > + return error_mark_node; These changes along with the enforce_access handling of cxx_dialect break C++03 code that currently works, such as template class A { typedef T I; }; template void f(typename T::I); template void f(int); int main() { f > (1); } Under the C++03 rules, we don't get access errors when generating overload candidates, we get them when the function is instantiated (i.e. in instantiate_decl). Hmm, now that I look at the code in instantiate_decl for re-substituting to get additional errors, I guess I should have factored that code out into a separate function and used it in the access7 patch rather than add handling of FNDECL_RECHECK_ACCESS_P in tsubst_decl. Jason