fprintf_unfiltered
(buf,
"auto " COMPILE_I_EXPR_VAL " = %s;\n"
- "decltype (" COMPILE_I_EXPR_VAL ") *" COMPILE_I_EXPR_PTR_TYPE ";\n"
+ "decltype ( %s ) *" COMPILE_I_EXPR_PTR_TYPE ";\n"
"std::memcpy (" COMPILE_I_PRINT_OUT_ARG ", %s ("
COMPILE_I_EXPR_VAL "),\n"
- "sizeof (" COMPILE_I_EXPR_VAL "));\n"
- ,input,
+ "sizeof (decltype(%s)));\n"
+ ,input, input,
(type == COMPILE_I_PRINT_ADDRESS_SCOPE
- ? "std::__addressof" : ""));
+ ? "std::__addressof" : ""), input);
break;
default:
-# Copyright 2015, 2016 Free Software Foundation, Inc.
+# Copyright 2015, 2016, 2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
CompileExpression::test "d.b_" 2
CompileExpression::test "d.c_" 3
CompileExpression::test "d.d_" 4
-CompileExpression::test "d.A::do_it (1);" 2
-CompileExpression::test "d.B::do_it (1);" 1
-CompileExpression::test "d.C::do_it (1);" 3
+CompileExpression::test "d.A::do_it (1)" 2
+CompileExpression::test "d.B::do_it (1)" 1
+CompileExpression::test "d.C::do_it (1)" 3
-# Copyright 2015-2016 Free Software Foundation, Inc.
+# Copyright 2015-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
gdb_continue_to_breakpoint "testing location"
CompileExpression::new "var"
-CompileExpression::test "a->get_var ();" 21
-CompileExpression::test "a->get_var (static_cast<unsigned long> (1));" 100
-CompileExpression::test "a->get_var (static_cast<int> (1));" 101
-CompileExpression::test "a->get_var (static_cast<float> (1));" 102
-CompileExpression::test "a->get_var (static_cast<void *> (a));" 103
-CompileExpression::test "a->get_var (*a);" 104
-CompileExpression::test "a->get_var (*ac);" 105
-CompileExpression::test "a->get_var1 (1);" 42
-CompileExpression::test "a->get_var2 (1, 2);" 88
-CompileExpression::test "A::get_1 (1);" 2
-CompileExpression::test "A::get_2 (1, 2);" 5
-CompileExpression::test "A::get_1 (a->get_var ());" 22
-CompileExpression::test "a->get_var1 (a->get_var () - 16);" 672
-CompileExpression::test "a->get_var2 (a->get_var (), A::get_1 (2));" 336
+CompileExpression::test "a->get_var ()" 21
+CompileExpression::test "a->get_var (static_cast<unsigned long> (1))" 100
+CompileExpression::test "a->get_var (static_cast<int> (1))" 101
+CompileExpression::test "a->get_var (static_cast<float> (1))" 102
+CompileExpression::test "a->get_var (static_cast<void *> (a))" 103
+CompileExpression::test "a->get_var (*a)" 104
+CompileExpression::test "a->get_var (*ac)" 105
+CompileExpression::test "a->get_var1 (1)" 42
+CompileExpression::test "a->get_var2 (1, 2)" 88
+CompileExpression::test "A::get_1 (1)" 2
+CompileExpression::test "A::get_2 (1, 2)" 5
+CompileExpression::test "A::get_1 (a->get_var ())" 22
+CompileExpression::test "a->get_var1 (a->get_var () - 16)" 672
+CompileExpression::test "a->get_var2 (a->get_var (), A::get_1 (2))" 336
CompileExpression::test "get_value ()" 200
CompileExpression::test "get_value (a)" 21
CompileExpression::test "get_value (get_value ())" 200
-# Copyright 2015, 2016 Free Software Foundation, Inc.
+# Copyright 2015, 2016, 2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
gdb_continue_to_breakpoint "testing location"
CompileExpression::new "var"
-CompileExpression::test "N1::N2::N3::N4::n4static;" 400
-CompileExpression::test "N1::N2::N3::N4::S4::s4static;" 40
-CompileExpression::test "s.s4int_;" 4
-CompileExpression::test "N1::N2::N3::N4::S4::get_svar ();" 40
-CompileExpression::test "s.get_var ();" 4
+CompileExpression::test "N1::N2::N3::N4::n4static" 400
+CompileExpression::test "N1::N2::N3::N4::S4::s4static" 40
+CompileExpression::test "s.s4int_" 4
+CompileExpression::test "N1::N2::N3::N4::S4::get_svar ()" 40
+CompileExpression::test "s.get_var ()" 4