aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2008-09-15 22:24:18 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2008-09-15 22:24:18 +0000
commit402b8cf659febc5377dc1680d35a60060ed72799 (patch)
treec7fecdbe7fcb04db014bde6d44be92149b600735 /gcc/cp/decl2.c
parent0eeb22402c9694e375f3a2b9113bcf94d30205cf (diff)
downloadgcc-402b8cf659febc5377dc1680d35a60060ed72799.zip
gcc-402b8cf659febc5377dc1680d35a60060ed72799.tar.gz
gcc-402b8cf659febc5377dc1680d35a60060ed72799.tar.bz2
crash16.C: Function name is the correct location for an error regarding a function.
testsuite/ * g++.old-deja/g++.brendan/crash16.C: Function name is the correct location for an error regarding a function. * g++.old-deja/g++.other/pmf3.C: Same. * g++.old-deja/g++.law/ctors5.C: Same. * g++.old-deja/g++.pt/explicit34.C: Same. * g++.dg/parse/error28.C: Same. * g++.dg/parse/error17.C: Same. * g++.dg/template/friend44.C: Same. cp/ * decl.c (duplicate_decls): Call error_at. (grokfndecl): New location argument. Use location if available. (grokdeclarator): Pass declarator location to grokfndecl. * cp-tree.h (struct cp_declarator): Update comment for id_loc. * decl2.c (check_classfn): Use error_at. * parser.c (cp_parser_init_declarator): Set function_start_locus to brace location. (cp_parser_member_declaration): Set id_loc for function declarators. From-SVN: r140379
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index a128fb7..5aecf3c 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -638,8 +638,9 @@ check_classfn (tree ctype, tree function, tree template_parms)
return OVL_CURRENT (fndecls);
}
- error ("prototype for %q#D does not match any in class %qT",
- function, ctype);
+ error_at (DECL_SOURCE_LOCATION (function),
+ "prototype for %q#D does not match any in class %qT",
+ function, ctype);
is_conv_op = DECL_CONV_FN_P (fndecl);
if (is_conv_op)