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