From patchwork Wed Dec 5 12:45:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 1008195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-491699-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Gj2xpWdU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="CKXVjIaA"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 438z4Q3D2rz9s3C for ; Wed, 5 Dec 2018 23:46:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=G7zeZBbgPhbmiyMj5yXyK2RqUKrg+NoQJqdjH5aAV0wC119Sej i5+ZpGXU7iICpo/3msiMOIxCgW1Z2OirIO2RJmBUn6SxJOm9ppx0VF8cn+WWWlOk LZnTW9DX2yY2RyiIf7pFO8lSd65/cMgaqkhioNHhdY1aVd2ID0EuGoH+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=3Rgs+QoNs/ENtFPpAVYTjG1Gs4o=; b=Gj2xpWdUIDfDuUhLMTJH ms/7WkFBEjbbzSSf9uPWqVbhx9dn2zBYK7+p0KfIMjVIYGCtyMqW+C8o94lb2sz3 QNV9XtTZoO589oK1pW2wgGwMnr0gUcqyAH3BBJcTFPb3frSP32P+DpwNXNzBGX9h dkPQQ5PhabUSj2/WE6glEk8= Received: (qmail 6666 invoked by alias); 5 Dec 2018 12:46:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6656 invoked by uid 89); 5 Dec 2018 12:46:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Dec 2018 12:46:04 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB5Ci3C5173683; Wed, 5 Dec 2018 12:46:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2018-07-02; bh=lzNammxDcSNfYL4GNPg5ilLa483+BYNkOvcpIiaG9zQ=; b=CKXVjIaAm0PL+PyJdvyDs1PCCDkUTGkzrVVCxhQD2EOJHBM8uwwwLbFR6XL+Cth7os+D s8jUTi4sallB9XhzwyQC8d80x2lgv07bf7zhqFReE2M14sOubn4t1OJ1WHqNgmPoMD5k uNTLCJPe35bVn7Qttnt5tmQUr9XbbnpC/rE7RP+uMMqG9vfDTaki0elckfoia9uCJ4d6 HxHG4SlEio+FxLlk9JH/XS9PVy0EkHMY7lrN4RWXYgw4bYWGwwWMQ2cUUMxEYwI9lr98 iVIAvT0AcHKubCEZepe+QMf88wieEkTFtnG/X0LWKBccHcy+FQ5rEUMxSVb5lfHZvP8j hw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2p3jxrj2ef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Dec 2018 12:46:02 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB5Ck1hZ016549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Dec 2018 12:46:01 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB5Ck1jX029900; Wed, 5 Dec 2018 12:46:01 GMT Received: from [192.168.42.150] (/2.41.82.20) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Dec 2018 04:46:00 -0800 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] Fix grokbitfield location Message-ID: Date: Wed, 5 Dec 2018 13:45:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, as mentioned in one of my last patches, we can now improve this location. Note: in the same function there are a few further issues which I mean to incrementally fix (eg, the diagnostics for warn_if_not_aligned ICEs for unnamed bit-fields). Tested x86_64-linux. Thanks, Paolo. //////////////// /cp 2018-12-05 Paolo Carlini * decl2.c (grokbitfield): USe DECL_SOURCE_LOCATION in error message. /testsuite 2018-12-05 Paolo Carlini * g++.dg/parse/bitfield6b.C: New. Index: cp/decl2.c =================================================================== --- cp/decl2.c (revision 266818) +++ cp/decl2.c (working copy) @@ -1027,7 +1027,8 @@ grokbitfield (const cp_declarator *declarator, && (INDIRECT_TYPE_P (value) || !dependent_type_p (TREE_TYPE (value)))) { - error ("bit-field %qD with non-integral type", value); + error_at (DECL_SOURCE_LOCATION (value), + "bit-field %qD with non-integral type", value); return error_mark_node; } Index: testsuite/g++.dg/parse/bitfield6b.C =================================================================== --- testsuite/g++.dg/parse/bitfield6b.C (nonexistent) +++ testsuite/g++.dg/parse/bitfield6b.C (working copy) @@ -0,0 +1,4 @@ +typedef void a(); +struct A { +a a1: 1; // { dg-error "3:bit-field .void A::a1\\(\\). with non-integral type" } +};