From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107373 invoked by alias); 3 Apr 2017 20:47:27 -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 107360 invoked by uid 89); 3 Apr 2017 20:47:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPAM_BODY,SPF_PASS autolearn=ham version=3.3.2 spammy=D*netcologne.de X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Apr 2017 20:47:25 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 80A4713384 for ; Mon, 3 Apr 2017 22:47:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 7B32111D90 for ; Mon, 3 Apr 2017 22:47:22 +0200 (CEST) Received: from [89.0.23.50] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 58e2b4da-0242-7f0000012729-7f000001ab77-1 for ; Mon, 03 Apr 2017 22:47:22 +0200 Received: from linux-w03z.fritz.box (xdsl-89-0-23-50.netcologne.de [89.0.23.50]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA for ; Mon, 3 Apr 2017 22:47:20 +0200 (CEST) Date: Mon, 03 Apr 2017 20:47:00 -0000 From: Volker Reichelt Subject: [Patch C++/80296] Fix broken diagnostic: 'unary_plus_expr' not supported by expression To: gcc-patches@gcc.gnu.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-SW-Source: 2017-04/txt/msg00111.txt.bz2 The following patch fixes a broken diagnostic: #'unary_plus_expr' not supported by expression# The code to handle UNARY_PLUS_EXPR is already in place in cxx_pretty_printer::unary_expression. However, UNARY_PLUS_EXPR is not checked in cxx_pretty_printer::expression, so that we don't call cxx_pretty_printer::unary_expression. Fixed with the patch below. Bootstrapped and regtested on x86_64-pc-linux-gnu. OK for trunk? Or should this wait for stage 1? Regards, Volker 2017-04-03 Volker Reichelt PR c++/80296 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add UNARY_PLUS_EXPR case. Index: gcc/cp/cxx-pretty-print.c =================================================================== --- gcc/cp/cxx-pretty-print.c (revision 246620) +++ gcc/cp/cxx-pretty-print.c (working copy) @@ -1112,6 +1112,7 @@ case SIZEOF_EXPR: case ALIGNOF_EXPR: case NOEXCEPT_EXPR: + case UNARY_PLUS_EXPR: unary_expression (t); break; 2017-04-03 Volker Reichelt PR c++/80296 * g++.dg/cpp0x/alias-decl-80296.C: New test. Index: gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C 2017-04-03 +++ gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C 2017-04-03 @@ -0,0 +1,9 @@ +// { dg-do compile { target c++11 } } +// { dg-bogus "not supported by" "" { target *-*-* } 0 } + +template struct A {}; + +template using B = A<+N...>; + +B b; // { dg-error "type/value mismatch" } + // { dg-message "expected a constant" "expected" { target *-*-* } 8 } ===================================================================