From patchwork Thu Nov 2 01:02:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p6X5L2c5YGl?= X-Patchwork-Id: 833161 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-465709-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="h0BoyXzg"; 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 3yS6J62CXVz9t3H for ; Thu, 2 Nov 2017 12:02:29 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=E6o04826gIoK+0VCMUzpW6mKKK7c5f6TUYvUP+Lnn0AXRe WC8gEEa97zvaRvhIQA3/qZuSqyv/jdVBW7SqcYRXtJtit2I5ilkt1JcmFZdP+aPq cyBBA4K3wmww3IPCZHuZbKyWniQBHkW+So8TZPGAxxwrgVlFtp9rotNRqGTyo= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=iM1JpjehYvhp2SE93K7XZkrihBg=; b=h0BoyXzgEBx47GnUlzlA Sjx7OmUE1JdaPOyBhNG/QONQmKBivZWEwkVOknzQpduoOHlDhajShwqbzWgL2MAo HF6hs9gRTw9NxI3EWX51XiHUtJTsBX5XWGuTWBCUnrCS0xIG9hzDyHQE6O9/r4tS GWYZkjBDbYbM0cRuTZ9opHE= Received: (qmail 4294 invoked by alias); 2 Nov 2017 01:02:22 -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 4278 invoked by uid 89); 2 Nov 2017 01:02:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ot0-f196.google.com Received: from mail-ot0-f196.google.com (HELO mail-ot0-f196.google.com) (74.125.82.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Nov 2017 01:02:19 +0000 Received: by mail-ot0-f196.google.com with SMTP id 96so283963otw.11 for ; Wed, 01 Nov 2017 18:02:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3F8Ku9qUhB/5YVgXxXl6cfR8TiuE/cmk5NVZWR42Y7M=; b=hgK43OHA3zpWT6al19QhvcRIvjnhnzO+BF6lniu6d1wCaq+54OnYYMSuz4NR92qEVZ yLqtt8oPIA8iyHniue8AqqtML8aTSv0t7yUPfZvJW4IHElzERrame0eUjsurMLoUrZUb /9eOoDrZ4VVdkPA0yhpqiAEuk+H/r2FvHGfp29k8wN3YQMZu91yxQfDjX1eIo1Ca4+Mt A5kYFI1PCZzrRYravAdx6Y0H5Ixuanr7Yo8zw55vwJBrBVpOLtBED3aCQnjLbd2zypiN rHfunLufyARkuslA3RpCSqK21i+wRkzhl4a9PTHb1wSSqWFVWN/hqjS/KD5Y+n2dutPq bCqg== X-Gm-Message-State: AJaThX5bNxLUw6TsDrYluZdbSlPPxw2UVF9Zbpt2TKkrApRoifTtC3os n64QeEDpT0QMQiwBWFZnRrEvOSdP9OY3OyPFoJMduw== X-Google-Smtp-Source: ABhQp+TAUjb9LFNUaJmfUNVvGJJJ1t+h8iliE3lQb15s9j7E7kHojhcFVTzCvFiBxn02yamaKs9MExIDNX8m/tm3okk= X-Received: by 10.157.20.202 with SMTP id r10mr1178373otr.455.1509584537465; Wed, 01 Nov 2017 18:02:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.170.199 with HTTP; Wed, 1 Nov 2017 18:02:17 -0700 (PDT) From: =?utf-8?b?5p6X5L2c5YGl?= Date: Thu, 2 Nov 2017 09:02:17 +0800 Message-ID: Subject: [PATCH] PR auto keyword variable lost its attributes/80986 To: gcc-patches The following patch aims to removing the attribute only tf_waring flag is on. warning (OPT_Wignored_attributes, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d1c846ecf44..8ff46498fd6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7410,7 +7410,10 @@ canonicalize_type_argument (tree arg, tsubst_flags_t complain) if (!arg || arg == error_mark_node || arg == TYPE_CANONICAL (arg)) return arg; bool removed_attributes = false; - tree canon = strip_typedefs (arg, &removed_attributes); + bool *premove_attributes = NULL; + if (complain & tf_warning) + premove_attributes = &removed_attributes; + tree canon = strip_typedefs (arg, premove_attributes); if (removed_attributes && (complain & tf_warning))