From patchwork Sun Sep 11 14:10:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 15507 Received: (qmail 4111 invoked by alias); 11 Sep 2016 14:10:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4085 invoked by uid 89); 11 Sep 2016 14:10:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Alpha, typeof 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 ESMTP; Sun, 11 Sep 2016 14:10:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 EEB0A61E63 for ; Sun, 11 Sep 2016 14:10:30 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8BEASoL003282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 11 Sep 2016 10:10:30 -0400 Date: Sun, 11 Sep 2016 16:10:27 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp Message-ID: <20160911141027.GA10024@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.0 (2016-08-17) X-IsSubscribed: yes Hi, gcc-6.2.1-1.fc26.x86_64 gdb compile failed, /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected primary-expression before 'int' decltype(int x) ^~~ /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected ')' before 'int' /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:1: error: expected unqualified-id before 'decltype' decltype(int x) ^~~~~~~~ /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc: In function 'int main(int, char**)': /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:59:14: error: expected primary-expression before 'decltype' double y = decltype(2); ^~~~~~~~ 'decltype' is a registered keyword since C++11 which is now a default for GCC. OK for check-in? Jan gdb/testsuite/ChangeLog 2016-09-11 Jan Kratochvil * gdb.cp/casts.cc: Rename decltype to int_to_double. * gdb.cp/casts.exp (whatis decltype(5)): Rename to ... (whatis int_to_double(5)): ... here. diff --git a/gdb/testsuite/gdb.cp/casts.cc b/gdb/testsuite/gdb.cp/casts.cc index 43f112f..4f68ba0 100644 --- a/gdb/testsuite/gdb.cp/casts.cc +++ b/gdb/testsuite/gdb.cp/casts.cc @@ -37,7 +37,7 @@ struct DoublyDerived : public VirtuallyDerived, // Confuse a simpler approach. double -decltype(int x) +int_to_double(int x) { return x + 2.0; } @@ -56,7 +56,7 @@ main (int argc, char **argv) Alpha *ad = &derived; Alpha *add = &doublyderived; - double y = decltype(2); + double y = int_to_double(2); return 0; /* breakpoint spot: casts.exp: 1 */ } diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp index 34a2492..5798098 100644 --- a/gdb/testsuite/gdb.cp/casts.exp +++ b/gdb/testsuite/gdb.cp/casts.exp @@ -112,7 +112,7 @@ gdb_test "print reinterpret_cast (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \ # Test that keyword shadowing works. -gdb_test "whatis decltype(5)" " = double" +gdb_test "whatis int_to_double(5)" " = double" # Basic tests using typeof.