|
|
7a6771 |
http://sourceware.org/ml/gdb-patches/2016-09/msg00082.html
|
|
|
7a6771 |
Subject: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp
|
|
|
7a6771 |
|
|
|
7a6771 |
|
|
|
7a6771 |
--ikeVEW9yuYc//A+q
|
|
|
7a6771 |
Content-Type: text/plain; charset=us-ascii
|
|
|
7a6771 |
Content-Disposition: inline
|
|
|
7a6771 |
|
|
|
7a6771 |
Hi,
|
|
|
7a6771 |
|
|
|
7a6771 |
gcc-6.2.1-1.fc26.x86_64
|
|
|
7a6771 |
|
|
|
7a6771 |
gdb compile failed, /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected primary-expression before 'int'
|
|
|
7a6771 |
decltype(int x)
|
|
|
7a6771 |
^~~
|
|
|
7a6771 |
/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected ')' before 'int'
|
|
|
7a6771 |
/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:1: error: expected unqualified-id before 'decltype'
|
|
|
7a6771 |
decltype(int x)
|
|
|
7a6771 |
^~~~~~~~
|
|
|
7a6771 |
/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc: In function 'int main(int, char**)':
|
|
|
7a6771 |
/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:59:14: error: expected primary-expression before 'decltype'
|
|
|
7a6771 |
double y = decltype(2);
|
|
|
7a6771 |
^~~~~~~~
|
|
|
7a6771 |
|
|
|
7a6771 |
'decltype' is a registered keyword since C++11 which is now a default for GCC.
|
|
|
7a6771 |
|
|
|
7a6771 |
OK for check-in?
|
|
|
7a6771 |
|
|
|
7a6771 |
|
|
|
7a6771 |
Jan
|
|
|
7a6771 |
|
|
|
7a6771 |
--ikeVEW9yuYc//A+q
|
|
|
7a6771 |
Content-Type: text/plain; charset=us-ascii
|
|
|
7a6771 |
Content-Disposition: inline; filename=1
|
|
|
7a6771 |
|
|
|
7a6771 |
gdb/testsuite/ChangeLog
|
|
|
7a6771 |
2016-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
7a6771 |
|
|
|
7a6771 |
* gdb.cp/casts.cc: Rename decltype to int_to_double.
|
|
|
7a6771 |
* gdb.cp/casts.exp (whatis decltype(5)): Rename to ...
|
|
|
7a6771 |
(whatis int_to_double(5)): ... here.
|
|
|
7a6771 |
|
|
|
7a6771 |
diff --git a/gdb/testsuite/gdb.cp/casts.cc b/gdb/testsuite/gdb.cp/casts.cc
|
|
|
7a6771 |
index 43f112f..4f68ba0 100644
|
|
|
7a6771 |
--- a/gdb/testsuite/gdb.cp/casts.cc
|
|
|
7a6771 |
+++ b/gdb/testsuite/gdb.cp/casts.cc
|
|
|
7a6771 |
@@ -37,7 +37,7 @@ struct DoublyDerived : public VirtuallyDerived,
|
|
|
7a6771 |
// Confuse a simpler approach.
|
|
|
7a6771 |
|
|
|
7a6771 |
double
|
|
|
7a6771 |
-decltype(int x)
|
|
|
7a6771 |
+int_to_double(int x)
|
|
|
7a6771 |
{
|
|
|
7a6771 |
return x + 2.0;
|
|
|
7a6771 |
}
|
|
|
7a6771 |
@@ -56,7 +56,7 @@ main (int argc, char **argv)
|
|
|
7a6771 |
Alpha *ad = &derived;
|
|
|
7a6771 |
Alpha *add = &doublyderived;
|
|
|
7a6771 |
|
|
|
7a6771 |
- double y = decltype(2);
|
|
|
7a6771 |
+ double y = int_to_double(2);
|
|
|
7a6771 |
|
|
|
7a6771 |
return 0; /* breakpoint spot: casts.exp: 1 */
|
|
|
7a6771 |
}
|
|
|
7a6771 |
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
|
|
|
7a6771 |
index 34a2492..5798098 100644
|
|
|
7a6771 |
--- a/gdb/testsuite/gdb.cp/casts.exp
|
|
|
7a6771 |
+++ b/gdb/testsuite/gdb.cp/casts.exp
|
|
|
7a6771 |
@@ -112,7 +112,7 @@ gdb_test "print reinterpret_cast (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \
|
|
|
7a6771 |
|
|
|
7a6771 |
# Test that keyword shadowing works.
|
|
|
7a6771 |
|
|
|
7a6771 |
-gdb_test "whatis decltype(5)" " = double"
|
|
|
7a6771 |
+gdb_test "whatis int_to_double(5)" " = double"
|
|
|
7a6771 |
|
|
|
7a6771 |
# Basic tests using typeof.
|
|
|
7a6771 |
|
|
|
7a6771 |
|
|
|
7a6771 |
--ikeVEW9yuYc//A+q--
|
|
|
7a6771 |
|