From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23006 invoked by alias); 2 May 2016 17:34:37 -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 22985 invoked by uid 89); 2 May 2016 17:34:36 -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= X-HELO: mail-qk0-f179.google.com Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 02 May 2016 17:34:34 +0000 Received: by mail-qk0-f179.google.com with SMTP id x7so77648608qkd.3 for ; Mon, 02 May 2016 10:34:34 -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=BW9LFu9kq8LKiP8m94sihTxKyZ0q0m5yHGB7jt8epHc=; b=I+MQC/QG3GO6JElHz93b0jGjs+BZQEIBobst7cGz3sOjg/Ch5UcPy11oQCmOwbQlYP MdfjA6nyFcu6ef5nvCFcrDRm4gsczZ9mxCwpeyTiWYSZqAh9n0/CRfHy9kRH1bQSDoVk z7J15Yg2J9hJpjKp/Cs0UFoeD2qkDBkeLEbbGCCS/QGRzKGpUQxngG4eFFuXMzTid7d9 LZkbLWTqZK0t79DT83vNG6jIiFVed3IBQFPl5QFT5j0OwKiKdmjUo9OQZT8ag8NYCYya VoFbJdnyqA8iFeE33SfAA7pF54TvoDXcP7xSWR2xh662uwxcO4+ZLGzcywhTJpc/OHaW YX+A== X-Gm-Message-State: AOPr4FVWl1sL4WDsAtzPL/exzrCKvTqC+c6xhzguteJjaoBfX96vctGkFVSmaPvs1FdBPV5L X-Received: by 10.55.78.84 with SMTP id c81mr33243527qkb.85.1462210472655; Mon, 02 May 2016 10:34:32 -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 b40sm9507762qga.47.2016.05.02.10.34.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2016 10:34:31 -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> Cc: GCC Patches From: Jason Merrill Message-ID: <57278FA6.90308@redhat.com> Date: Mon, 02 May 2016 17:34: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: <20160502164149.GE5348@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00121.txt.bz2 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? Jason