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