From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31301 invoked by alias); 19 Jun 2013 14:21:22 -0000 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 Received: (qmail 31277 invoked by uid 89); 19 Jun 2013 14:21:17 -0000 X-Spam-SWARE-Status: No, score=-7.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 19 Jun 2013 14:21:17 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5JELEkC002879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Jun 2013 10:21:14 -0400 Received: from [10.3.113.51] (ovpn-113-51.phx2.redhat.com [10.3.113.51]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5JELDoJ026098; Wed, 19 Jun 2013 10:21:13 -0400 Message-ID: <51C1BE59.6040400@redhat.com> Date: Wed, 19 Jun 2013 14:21:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:23.0) Gecko/20100101 Thunderbird/23.0a2 MIME-Version: 1.0 To: Andrew Sutton CC: Gabriel Dos Reis , gcc-patches@gcc.gnu.org Subject: Re: [c++-concepts] code review References: <51B0B0ED.5090508@redhat.com> <51B0F122.6020301@redhat.com> <51B62961.1080409@redhat.com> <51B8A36C.1080005@redhat.com> <51BBC613.5040708@redhat.com> <51BF617D.3080101@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg01127.txt.bz2 On 06/18/2013 12:27 PM, Andrew Sutton wrote: > There was a bug in instantiation_dependent_expr_r that would cause > trait expressions like __is_class(int) to be marked as type dependent. > It was always testing the 2nd operand, even for unary traits > (NULL_TREE turns out to be type dependent). I fixed that last month: 2013-05-20 Jason Merrill PR c++/57016 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2 if there is one. If you want to keep the is_binary_trait stuff, that's fine, except that > +extern bool is_binary_trait (cp_trait_kind); ... > +inline bool > +is_binary_trait (cp_trait_kind k) violates the rules for inline functions: an inline function must be declared as inline before any uses and defined in all translation units that use it. > +// reduced terms in the constraints language. Note that conjoining with a > +// non-null expression with NULL_TREE is an identity operation. That is, Drop the first "with". > + // If the types of the underlying templates match, compare > + // their constraints. The declarations could differ there. > + if (types_match) > + types_match = equivalent_constraints (get_constraints (olddecl), > + current_template_reqs); We can't assume that current_template_reqs will always apply to newdecl here, as decls_match is called in overload resolution as well. What's the problem with attaching the requirements to the declaration before we get to duplicate_decls? Jason