diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2005-02-15 19:37:13 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2005-02-15 19:37:13 +0000 |
commit | 39a87435bc42d0802f82b60bf657b3aa5ecbea86 (patch) | |
tree | 8822a8644e32fc77102ecb5cd7a2e7c116ba4707 /gcc/cp/method.c | |
parent | 83cc36c8268ff644059eb99f0e2e4670e3fff841 (diff) | |
download | gcc-39a87435bc42d0802f82b60bf657b3aa5ecbea86.zip gcc-39a87435bc42d0802f82b60bf657b3aa5ecbea86.tar.gz gcc-39a87435bc42d0802f82b60bf657b3aa5ecbea86.tar.bz2 |
decl2.c (mark_used): Set the source location of the used decl to the current input location here...
* decl2.c (mark_used): Set the source location of the used decl to
the current input location here...
* method.c (synthesize_method): ... not here. Set input_location
from the decl instead.
From-SVN: r95070
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index fadbf39..85e2b3f 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -705,12 +705,15 @@ synthesize_method (tree fndecl) tree context = decl_function_context (fndecl); bool need_body = true; tree stmt; + location_t save_input_location = input_location; /* If we've been asked to synthesize a clone, just synthesize the cloned function instead. Doing so will automatically fill in the body for the clone. */ if (DECL_CLONED_FUNCTION_P (fndecl)) { + DECL_SOURCE_LOCATION (DECL_CLONED_FUNCTION (fndecl)) = + DECL_SOURCE_LOCATION (fndecl); synthesize_method (DECL_CLONED_FUNCTION (fndecl)); return; } @@ -724,13 +727,7 @@ synthesize_method (tree fndecl) else if (nested) push_function_context_to (context); - /* Put the function definition at the position where it is needed, - rather than within the body of the class. That way, an error - during the generation of the implicit body points at the place - where the attempt to generate the function occurs, giving the - user a hint as to why we are attempting to generate the - function. */ - DECL_SOURCE_LOCATION (fndecl) = input_location; + input_location = DECL_SOURCE_LOCATION (fndecl); start_preparsed_function (fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED); stmt = begin_function_body (); @@ -761,6 +758,8 @@ synthesize_method (tree fndecl) finish_function_body (stmt); expand_or_defer_fn (finish_function (0)); + input_location = save_input_location; + if (! context) pop_from_top_level (); else if (nested) |