aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2005-02-15 19:37:13 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2005-02-15 19:37:13 +0000
commit39a87435bc42d0802f82b60bf657b3aa5ecbea86 (patch)
tree8822a8644e32fc77102ecb5cd7a2e7c116ba4707 /gcc/cp/decl2.c
parent83cc36c8268ff644059eb99f0e2e4670e3fff841 (diff)
downloadgcc-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/decl2.c')
-rw-r--r--gcc/cp/decl2.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 0a74ed7..c7b0415 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3161,9 +3161,20 @@ mark_used (tree decl)
&& DECL_ARTIFICIAL (decl)
&& !DECL_THUNK_P (decl)
&& ! DECL_INITIAL (decl)
- /* Kludge: don't synthesize for default args. */
+ /* Kludge: don't synthesize for default args. Unfortunately this
+ rules out initializers of namespace-scoped objects too, but
+ it's sort-of ok if the implicit ctor or dtor decl keeps
+ pointing to the class location. */
&& current_function_decl)
{
+ /* 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 (decl) = input_location;
+
synthesize_method (decl);
/* If we've already synthesized the method we don't need to
instantiate it, so we can return right away. */