From patchwork Thu Jul 21 14:38:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 651214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3rwGbw66J2z9sf9 for ; Fri, 22 Jul 2016 00:38:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Vs0BBTrj; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; q=dns; s=default; b=P5ylQlt4BZmahZHZ kQpDzecVTlShUn2g7LTJ0g7fQcYxpJpbyYuuQ/ht15eEpaCzWeBUQqngHGkHVrcf hFhyNX6ytRTdXylxHzAetF6JwKoB5yE8kYFFoKQdjstPhaf3gMJl0Fbuzp1XDgJl g5/6eX1091/ojXccz3oouCuH46k= 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 :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; s=default; bh=NKVp+S8sszfQsnDtMGCAWL OjksQ=; b=Vs0BBTrjIey2OiDv6s4WE57ZoS1HuD02QJqaazetwW7M77U1Ov9cwE MuGbmh1/UPxObQSKBYLcYNIfnqhs7cuFerLCs/K1i8LSHPXusvjdJQEStHM1Tz8L fBhqr4UXUIyjspgYG+pWAlc3ZG51yuTwkPzm669LYnTbY+62CFWHA= Received: (qmail 125736 invoked by alias); 21 Jul 2016 14:38:10 -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 125724 invoked by uid 89); 21 Jul 2016 14:38:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hello!, Hello! X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Jul 2016 14:38:08 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03C3A769FC; Thu, 21 Jul 2016 14:38:07 +0000 (UTC) Received: from vpn-227-148.phx2.redhat.com (vpn-227-148.phx2.redhat.com [10.3.227.148]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6LEc56n005622; Thu, 21 Jul 2016 10:38:06 -0400 Message-ID: <1469111885.29375.21.camel@redhat.com> Subject: Re: [PATCH 2/2] C++ FE: handle misspelled identifiers and typenames From: David Malcolm To: Uros Bizjak , "gcc-patches@gcc.gnu.org" Cc: Jeff Law Date: Thu, 21 Jul 2016 10:38:05 -0400 In-Reply-To: <1469111299.29375.16.camel@redhat.com> References: <1469111299.29375.16.camel@redhat.com> Mime-Version: 1.0 X-IsSubscribed: yes On Thu, 2016-07-21 at 10:28 -0400, David Malcolm wrote: > On Thu, 2016-07-21 at 09:00 +0200, Uros Bizjak wrote: > > Hello! > > > > > > gcc/ChangeLog: > > > > PR c/70339 > > > > * diagnostic-show-locus.c (diagnostic_show_locus): If this is > > > > the > > > > same location as last time, don't skip if we have fix-it hints. > > > > Clarify the skipping logic by converting it from one "if" > > > > clause > > > > to repeated "if" clauses. > > > > * spellcheck-tree.c: Include "cpplib.h". > > > > (find_closest_macro_cpp_cb): Move here from c/c-decl.c. > > > > (best_macro_match::best_macro_match): New constructor. > > > > * spellcheck-tree.h (struct edit_distance_traits > > > *>): > > > > Move here from c/c-decl.c. > > > > (class best_macro_match): Move here from c/c-decl.c, converting > > > > from a typedef to a subclass, gaining a ctor. > > > > This part introduced bootstrap failure on CentOS 5.11: > > > > g++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing > > -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall > > -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute > > -Woverloaded-virtual -fno-common -DHAVE_CONFIG_H -I. -I. > > -I../../git/gcc/gcc -I../../git/gcc/gcc/. > > -I../../git/gcc/gcc/../include > > -I../../git/gcc/gcc/../libcpp/include > > -I/usr/local/include -I/usr/local/include -I/usr/local/include > > -I../../git/gcc/gcc/../libdecnumber > > -I../../git/gcc/gcc/../libdecnumber/bid -I../libdecnumber > > -I../../git/gcc/gcc/../libbacktrace -o spellcheck-tree.o -MT > > spellcheck-tree.o -MMD -MP -MF ./.deps/spellcheck-tree.TPo > > ../../git/gcc/gcc/spellcheck-tree.c > > ../../git/gcc/gcc/spellcheck-tree.c: In constructor > > ‘best_macro_match::best_macro_match(tree_node*, edit_distance_t, > > cpp_reader*)’: > > ../../git/gcc/gcc/spellcheck-tree.c:94: error: class > > ‘best_macro_match’ does not have any field named ‘best_match’ > > ../../git/gcc/gcc/spellcheck-tree.c:94: error: no matching function > > for call to ‘best_match::best_match()’ > > ../../git/gcc/gcc/spellcheck.h:91: note: candidates are: > > best_match::best_match(GOAL_TYPE, > > edit_distance_t) [with GOAL_TYPE = tree_node*, CANDIDATE_TYPE = > > cpp_hashnode*] > > ../../git/gcc/gcc/spellcheck.h:81: note: > > best_match::best_match(const > > best_match&) > > gmake: *** [spellcheck-tree.o] Error 1 > > > > CentOS 5 has pretty old system compiler [gcc version 4.1.2 20080704 > > (Red Hat 4.1.2-55)], but the build worked until the above patch was > > committed. Is it possible to work around this failure somehow? > > Sorry about the breakage. > > I've now built a gcc 4.1 locally, and with that I can reproduce the > issue. Am investigating... The following patch seems to fix it; successfully compiles that file with my local builds of gcc 7 and gcc 4.1 (and with Fedora system gcc 4.8.3). Does it fix the build for you? Bootstrap®rtesting underway here. gcc/ChangeLog: * spellcheck-tree.c (best_macro_match::best_macro_match): Explicitly specify the template arguments when invoking the base class constructor, to help older C++ compilers. Sorry again about the breakage. Dave diff --git a/gcc/spellcheck-tree.c b/gcc/spellcheck-tree.c index ef1e689..99a8dba 100644 --- a/gcc/spellcheck-tree.c +++ b/gcc/spellcheck-tree.c @@ -91,7 +91,7 @@ find_closest_macro_cpp_cb (cpp_reader *, cpp_hashnode *hashnode, best_macro_match::best_macro_match (tree goal, edit_distance_t best_distance_so_far, cpp_reader *reader) - : best_match (goal, best_distance_so_far) +: best_match (goal, best_distance_so_far) { cpp_forall_identifiers (reader, find_closest_macro_cpp_cb, this); }