From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp
Date: Sun, 11 Sep 2016 14:10:00 -0000 [thread overview]
Message-ID: <20160911141027.GA10024@host1.jankratochvil.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
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
[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 1245 bytes --]
gdb/testsuite/ChangeLog
2016-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* 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<A &> (*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.
next reply other threads:[~2016-09-11 14:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 14:10 Jan Kratochvil [this message]
2016-09-15 12:07 ` Pedro Alves
2016-09-15 13:25 ` Tom Tromey
2016-09-15 22:06 ` [testsuite patchv2] " Jan Kratochvil
2016-09-16 15:45 ` Pedro Alves
2016-09-16 17:25 ` [commit] " Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160911141027.GA10024@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).