Fix crash.
* valops.c (compare_parameters): Verify TYPE_NFIELDS before
touching TYPE_FIELD_ARTIFICIAL.
gdb/testsuite/
* gdb.cp/noparam.exp: New file.
* gdb.cp/noparam.cc: New file.
+2011-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix crash.
+ * valops.c (compare_parameters): Verify TYPE_NFIELDS before
+ touching TYPE_FIELD_ARTIFICIAL.
+
2011-01-28 Richard Earnshaw <rearnsha@arm.com>
* MAINTAINERS: Move myself from Responsible Maintainers to Authorized
+2011-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.cp/noparam.exp: New file.
+ * gdb.cp/noparam.cc: New file.
+
2011-01-28 Pedro Alves <pedro@codesourcery.com>
* gdb.trace/tfile.exp: Test that with no traceframe selected,
--- /dev/null
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+class C
+{
+public:
+ static void m () {}
+};
+
+int
+main ()
+{
+ C::m ();
+ return 0;
+}
--- /dev/null
+# Copyright 2011 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if { [prepare_for_testing noparam.exp "noparam" "noparam.cc" {debug c++}] } {
+ return -1
+}
+
+# Check if GDB does not crash.
+gdb_test "p C::m (int)" "no member function matches that type instantiation"
{
int start = 0;
- if (TYPE_FIELD_ARTIFICIAL (t1, 0))
+ if (TYPE_NFIELDS (t1) > 0 && TYPE_FIELD_ARTIFICIAL (t1, 0))
++start;
/* If skipping artificial fields, find the first real field