aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-ada-spec.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2012-10-11 10:29:54 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-10-11 10:29:54 +0000
commitf5b02f1ec1a25063efed41329cee69a6c530b0ed (patch)
treeff32c81097404a5c83b7f08bba9d0881d180a0ea /gcc/c-family/c-ada-spec.c
parent770e9be943fdf95399494d595c3e2cefa02d5b0e (diff)
downloadgcc-f5b02f1ec1a25063efed41329cee69a6c530b0ed.zip
gcc-f5b02f1ec1a25063efed41329cee69a6c530b0ed.tar.gz
gcc-f5b02f1ec1a25063efed41329cee69a6c530b0ed.tar.bz2
c-ada-spec.c (dump_ada_template): Bail out for template declarations declaring something coming from another file.
* c-ada-spec.c (dump_ada_template): Bail out for template declarations declaring something coming from another file. From-SVN: r192353
Diffstat (limited to 'gcc/c-family/c-ada-spec.c')
-rw-r--r--gcc/c-family/c-ada-spec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 36a86e5..631ee7a 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -1700,10 +1700,18 @@ static int
dump_ada_template (pretty_printer *buffer, tree t,
int (*cpp_check)(tree, cpp_operation), int spc)
{
- tree inst = DECL_VINDEX (t);
/* DECL_VINDEX is DECL_TEMPLATE_INSTANTIATIONS in this context. */
+ tree inst = DECL_VINDEX (t);
+ /* DECL_RESULT_FLD is DECL_TEMPLATE_RESULT in this context. */
+ tree result = DECL_RESULT_FLD (t);
int num_inst = 0;
+ /* Don't look at template declarations declaring something coming from
+ another file. This can occur for template friend declarations. */
+ if (LOCATION_FILE (decl_sloc (result, false))
+ != LOCATION_FILE (decl_sloc (t, false)))
+ return 0;
+
while (inst && inst != error_mark_node)
{
tree types = TREE_PURPOSE (inst);