From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112920 invoked by alias); 4 May 2016 00:05:52 -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 112905 invoked by uid 89); 4 May 2016 00:05:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-languages-length:1624 X-HELO: mail-qk0-f182.google.com Received: from mail-qk0-f182.google.com (HELO mail-qk0-f182.google.com) (209.85.220.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 May 2016 00:05:50 +0000 Received: by mail-qk0-f182.google.com with SMTP id n63so16984994qkf.0 for ; Tue, 03 May 2016 17:05:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=7xVcbDEDQuRk3VXXJxdxS7w4+K1UwJbYpsCXEkgngQ4=; b=WXYcm5ZFPsh5f38LNIV7OELo6RDCZTpyDBUGnF1hZa7vw7hpNGuR9+rqa9kZoS+mcM d9psiWsj+c4Ofn1X1k3Vmr+h8X9JStW8Dufe6AFP/DBHfqSIHyAdY+4DVp6urZiAdLci 8d3VrEQihX2XFqrVXGXyX+PW8ybOeFRdKrRxcPC7jVY9RR6uIVqdZwD/wzTm/kqrvG1N ZCjm8ya/M3HZO+R4RTBNJOp5/C5b1WAZNGvn5sWHmGdG0ODgV4Wvm9YXH+A6h7sdq+Ba jxvM8HAZF3Jcrt0X8jyGZopShGYCztakjXBFwryv9b7HNQxlCtPXvgGPksPzeFuvDtg/ TBvA== X-Gm-Message-State: AOPr4FVX3a7kLqaF/f3THUDxfdWhcNKY6Bo2lgw/UlMaiAs9w/toNDXa6eIZBP9wL0Vx5rNX X-Received: by 10.55.40.227 with SMTP id o96mr5734715qko.23.1462320348580; Tue, 03 May 2016 17:05:48 -0700 (PDT) Received: from [192.168.1.50] (209-6-90-240.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com. [209.6.90.240]) by smtp.gmail.com with ESMTPSA id h83sm332035qhh.4.2016.05.03.17.05.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2016 17:05:48 -0700 (PDT) Subject: Re: [PATCH] Better location info for "incomplete type" error msg (PR c/70756) To: Marek Polacek References: <20160428155908.GQ28445@redhat.com> <5723BE3D.4070706@redhat.com> <20160502164149.GE5348@redhat.com> <57278FA6.90308@redhat.com> <20160503112707.GH5348@redhat.com> Cc: GCC Patches From: Jason Merrill Message-ID: <57293CDB.6040204@redhat.com> Date: Wed, 04 May 2016 00:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160503112707.GH5348@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00258.txt.bz2 On 05/03/2016 07:27 AM, Marek Polacek wrote: > On Mon, May 02, 2016 at 01:34:30PM -0400, Jason Merrill wrote: >> On 05/02/2016 12:41 PM, Marek Polacek wrote: >>> On Fri, Apr 29, 2016 at 04:04:13PM -0400, Jason Merrill wrote: >>>> On 04/28/2016 11:59 AM, Marek Polacek wrote: >>>>> 3) for the C++ FE I used a macro so that I don't have to change all the >>>>> cxx_incomplete_type_error calls now, >>>> >>>> How about an inline overload, instead? >>> >>> I realized the macro was already there, but inline overloads should probably >>> be preferred these days. So I used them instead. >>> >>>> It seems sad to discard the location information; could we pass it into >>>> cxx_incomplete_type_diagnostic? >>> >>> I suppose I can, though it required another inline overload. I'm not sure >>> if the patch will make the C++ diagnostics about incomplete types better, >>> most likely not :/. >>> +inline void >>> +cxx_incomplete_type_diagnostic (const_tree value, const_tree type, >>> + diagnostic_t diag_kind) >>> +{ >>> + cxx_incomplete_type_diagnostic (input_location, value, type, diag_kind); >>> +} >>> + >> >> ... >> >>> -cxx_incomplete_type_diagnostic (const_tree value, const_tree type, >>> - diagnostic_t diag_kind) >>> +cxx_incomplete_type_diagnostic (location_t loc, const_tree value, >>> >>> - location_t loc = EXPR_LOC_OR_LOC (value, input_location); >> >> Shouldn't we use EXPR_LOC_OR_LOC in the inline? > > That, I suppose, is a good idea ;). Thus: Looks good. But I don't see a C++ testcase; can the test go into c-c++-common? Jason