gdb 7.6 没有这个问题。
[root@localhost ~]# gdb ./a.out
GNU gdb (GDB) Fedora (7.6-30.fc19)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/a.out...done.
(gdb) b main
Breakpoint 1 at 0x80485b9: file a.cpp, line 11.
(gdb) r
Starting program: /root/a.out
Breakpoint 1, main () at a.cpp:11
11 std::array<double, 5> a = {0, 1.1, 2.2, 3.3, 4.4};
Missing separate debuginfos, use: debuginfo-install glibc-2.17-4.fc19.i686 libgcc-
4.8.1-1.fc19.i686 libstdc++-4.8.1-1.fc19.i686
(gdb) n
12 std::array<double, 5> b = {5.5, 6.6, 7.7, 8.8, 9.9};
(gdb)
13 dotprod(a, b);
(gdb) s
dotprod<5u> (v1=..., v2=...) at a.cpp:7
7 return 0;
(gdb) p v1
$1 = (const std::array<double, 5u> &) @0xbffff640: {_M_elems = {0, 1.1000000000000001, 2.2000000000000002,
3.2999999999999998, 4.4000000000000004}}
(gdb)