From patchwork Tue Jul 16 08:48:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1132525 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-505120-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jpbI3N39"; 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 45nvFg5Rqbz9s7T for ; Tue, 16 Jul 2019 18:48:55 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=SYKPyljE1iQEB/1b 0tt1hLX9rQhHrsOoUqgDkwjggcwEaL06UhhZbRQct13CN2Z8Wyd3ecNGr6/fYgq3 R8aMLL74/chLMyK8VMrK8Evrt2W/sD1uvsZm/r3XJt2RcWEMOhMxorg6OMIMpxgW LORge8RxCQoZLJPmLpyaP4VyFKE= 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:from :to:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=vaEy9OmNWHUpq+PZ3JZ55I v0Fzc=; b=jpbI3N39ybvfkC/SVl84Am7ciMQU9uPqseQSTQJHp9GP5hQ7xciEMr 2QPKcgVXip6yUbSoRpVJawnCyQTSu5tArkI0qcTZq7tRiFgoQ9fRA4gxd0uz9NzS yz1V05sDwfasuUp0667yeaaPHjYugtMj7Tu14sAzA7iMb1RKZ+a2g= Received: (qmail 115431 invoked by alias); 16 Jul 2019 08:48:49 -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 115422 invoked by uid 89); 16 Jul 2019 08:48:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=alone, concepts, HContent-Transfer-Encoding:8bit X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Jul 2019 08:48:47 +0000 Received: by mail-wr1-f67.google.com with SMTP id x1so4972846wrr.9 for ; Tue, 16 Jul 2019 01:48:47 -0700 (PDT) Received: from localhost.localdomain ([62.153.214.124]) by smtp.gmail.com with ESMTPSA id r14sm17776994wrx.57.2019.07.16.01.48.43 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 01:48:44 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] Fix g++.dg/template/pr84789.C on new concepts branch. Date: Tue, 16 Jul 2019 10:48:35 +0200 Message-Id: <20190716084835.32606-1-jason@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes On the concepts branch I ran into trouble where a pre-parsed dependent nested-name-specifier got replaced on a subsequent parse with is_declaration by one with typenames resolved, which was then used wrongly on a further parse with !is_declaration. Tested x86_64-pc-linux-gnu, applying to trunk. * parser.c (cp_parser_nested_name_specifier_opt): If the token is already CPP_NESTED_NAME_SPECIFIER, leave it alone. --- gcc/cp/parser.c | 3 ++- gcc/cp/ChangeLog | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) base-commit: 48db11b0846d94dbb8d620cfca36eb00f5644d1c diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f91c50ead67..14a2168eb6d 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6275,7 +6275,8 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser, cp_token *token; /* Remember where the nested-name-specifier starts. */ - if (cp_parser_uncommitted_to_tentative_parse_p (parser)) + if (cp_parser_uncommitted_to_tentative_parse_p (parser) + && cp_lexer_next_token_is_not (parser->lexer, CPP_NESTED_NAME_SPECIFIER)) { start = cp_lexer_token_position (parser->lexer, false); push_deferring_access_checks (dk_deferred); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a18959d6388..bd85c705629 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-07-16 Jason Merrill + + * parser.c (cp_parser_nested_name_specifier_opt): If the token is + already CPP_NESTED_NAME_SPECIFIER, leave it alone. + 2019-07-12 Jakub Jelinek * parser.c (cp_parser_omp_clause_name): Handle order clause.