aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-06-02 17:52:28 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-06-02 17:52:28 +0000
commit3e3935a94ce8702a788cd3e76eab584ed09277e8 (patch)
treea0248ab483fa16d5d61e52a91d59af7f8fbedf6f /gcc/cp/decl.c
parent646221d67de0d8ddfe9b35570c8e52a544e20194 (diff)
downloadgcc-3e3935a94ce8702a788cd3e76eab584ed09277e8.zip
gcc-3e3935a94ce8702a788cd3e76eab584ed09277e8.tar.gz
gcc-3e3935a94ce8702a788cd3e76eab584ed09277e8.tar.bz2
re PR c++/21280 (#pragma interface, templates, and "inline function used but never defined")
cp: PR c++/21280 * Make-lang.in (method.o): Add diagnostic.h * decl.c (start_preparsed_function): Use decl's location for file info. * decl2.c (cp_finish_file): Set input_location before synthesizing a function. (mark_used): When deferring a synthesized function, save current location. Do not set function's location when actually synthesizing it. * method.c: #include diagnostic.h. (synthesize_method): Set the functions source location. Show needed location if errors are emitted. testsuite: PR c++/21280 * g++.dg/opt/interface2.h: New. * g++.dg/opt/interface2.C: New. * g++.dg/init/ctor4.C: Adjust error lines. * g++.old-deja/g++.bob/inherit2.C: Likewise. * g++.old-deja/g++.bugs/900205_04.C: Likewise. * g++.old-deja/g++.jason/opeq3.C: Likewise. * g++.old-deja/g++.pt/assign1.C: Likewise. * g++.old-deja/g++.pt/crash20.C: Likewise. From-SVN: r100500
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 83c6719..6f1394b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9879,7 +9879,8 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
int doing_friend = 0;
struct cp_binding_level *bl;
tree current_function_parms;
- struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename));
+ struct c_fileinfo *finfo
+ = get_fileinfo (lbasename (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1))));
/* Sanity check. */
gcc_assert (TREE_CODE (TREE_VALUE (void_list_node)) == VOID_TYPE);