From patchwork Thu Feb 8 16:09:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 870919 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-472866-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dHrHmugE"; 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 3zcjnh1h73z9ryr for ; Fri, 9 Feb 2018 03:09:43 +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 :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Ssdh/JChBdtcovnCcYNNthZxMm/O2cUkmN+/0gWfg/JiQjmrQf N2A+Y19aXRC5hqg6zeUJ386oZiF/Mpxniyx/dpnU4rjo4wAlkkAd9aXlbG1Wz/VE FLZ/KYcnkr4eNfrBj4iMGe70iNrKPkaHCSg9HdT6jXzXVx53JNh1Ta+1s= 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 :from:subject:message-id:date:mime-version:content-type; s= default; bh=QfvZpAmcx3dDIhrzrsQizQvj98c=; b=dHrHmugETckAwkIn95mc 0LS1ZmDDXz7M1/WNcGdxii3EzUTSjFF4zey3t0ep7XyNoWYaOuYLs6BVXFLzdZL3 1a0k19H/Y8asUOlnoZ5XTALsqliDbRFD4VHS/0NZhOZ5feXkC3uRBOVaqr60tYRf idG25HQOGtweFsPo0FYFiMg= Received: (qmail 55425 invoked by alias); 8 Feb 2018 16:09:36 -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 55412 invoked by uid 89); 8 Feb 2018 16:09:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=257482 X-HELO: mail-yw0-f174.google.com Received: from mail-yw0-f174.google.com (HELO mail-yw0-f174.google.com) (209.85.161.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Feb 2018 16:09:32 +0000 Received: by mail-yw0-f174.google.com with SMTP id x62so2951996ywg.11 for ; Thu, 08 Feb 2018 08:09:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=bKuh8VxR2VaBtmUfzgSdZAvYB48QGhOTEhQ8DqaRdzY=; b=SZuu40YhCiDKVGcVu/ty4UASClkgFLVHB0eq46iNwgmwtBEmgOK4zAGG1EFYSrYvew ebeu/jxRw+Exgx/Ji3mOx3CAfU+emn8h7Iq6MWGvNC7BClLQ+uxunipAfky7N5NcNfd1 gRjE6AOuNmmJ1BlYrPkcNLQzat4OGhqxeMYXNVyrmv3GXZC+0Lu38M3h9lynkBWPrj8S c7Gsesb9OHi7xI/rXUXLhI3CPfDeTuLTAI/EZQt2mM4yDInRBv4zSz6ZDD3SsE5C2v68 paX97Zag5ifzRpSQqA9f7WxWzLSCu1iF7r1wobTUJcAwku4zUacmClIUnIpF543LRFQ7 Friw== X-Gm-Message-State: APf1xPDrpxTF2hQpTr6JZZtT7eQ5LXZBu/RFHcXIme0+JfzF4VUhJjU3 kBM2pq9n7MrLdeYG1frJAGo= X-Google-Smtp-Source: AH8x224a1HBmN9N4lKc0kMvk4JRNUbnMQhCbNweGo4y0HaSqhGBZ3M+Wux9hHqMasDjnN4829P1LFQ== X-Received: by 10.129.157.17 with SMTP id u17mr875038ywg.86.1518106170728; Thu, 08 Feb 2018 08:09:30 -0800 (PST) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:9e4e]) by smtp.googlemail.com with ESMTPSA id z30sm96098ywj.15.2018.02.08.08.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 08:09:30 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] initializer_list diagnostic Message-ID: Date: Thu, 8 Feb 2018 11:09:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 when working on 84263 I noticed this initializer_list diagnostic wasn't correctly formatted. Fixing thusly. nathan 2018-02-08 Nathan Sidwell * class.c (finish_struct): Fix std:initializer_list diagnostic formatting. * g++.dg/cpp0x/initlist93.C: Adjust diagnostic. Index: cp/class.c =================================================================== --- cp/class.c (revision 257482) +++ cp/class.c (working copy) @@ -7062,7 +7062,7 @@ finish_struct (tree t, tree attributes) /* People keep complaining that the compiler crashes on an invalid definition of initializer_list, so I guess we should explicitly reject it. What the compiler internals care about is that it's a - template and has a pointer field followed by an integer field. */ + template and has a pointer field followed by size_type field. */ bool ok = false; if (processing_template_decl) { @@ -7075,9 +7075,8 @@ finish_struct (tree t, tree attributes) } } if (!ok) - fatal_error (input_location, - "definition of std::initializer_list does not match " - "#include "); + fatal_error (input_location, "definition of %qD does not match " + "%<#include %>", TYPE_NAME (t)); } input_location = saved_loc; Index: testsuite/g++.dg/cpp0x/initlist93.C =================================================================== --- testsuite/g++.dg/cpp0x/initlist93.C (revision 257482) +++ testsuite/g++.dg/cpp0x/initlist93.C (working copy) @@ -3,7 +3,7 @@ namespace std { -template class initializer_list // { dg-error "definition of std::initializer_list does not match" } +template class initializer_list // { dg-error "definition of .*std::initializer_list.* does not match" } { int *_M_array; int _M_len;