aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Koenig <koenigni@student.ethz.ch>2017-03-21 14:49:21 +0000
committerNicolas Koenig <koenigni@student.ethz.ch>2017-03-21 14:49:21 +0000
commit3414abbd9b989a6f328d974fe84233c433f94f92 (patch)
treecae26851920d8ab9f1d973ff75985aa00bfc8d22
parent5b7dd42e3bed9a276ac2e1c5a3b13ad7ebffff49 (diff)
2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
PR fortran/69498 * decl.c (add_hidden_procptr_result): Fixed Refs count of the created "ppr@" symbol. 2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch> PR fortran/69498 * gfortran.dg/unexp_attribute.f90: New test git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@246322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/decl.c1
-rw-r--r--gcc/testsuite/gfortran.dg/unexp_attribute.f908
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 52de1c11312..7d61fbf37af 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -5430,6 +5430,7 @@ add_hidden_procptr_result (gfc_symbol *sym)
gfc_get_sym_tree ("ppr@", gfc_current_ns->parent, &stree, false);
st2 = gfc_new_symtree (&gfc_current_ns->sym_root, "ppr@");
st2->n.sym = stree->n.sym;
+ stree->n.sym->refs++;
}
sym->result = stree->n.sym;
diff --git a/gcc/testsuite/gfortran.dg/unexp_attribute.f90 b/gcc/testsuite/gfortran.dg/unexp_attribute.f90
new file mode 100644
index 00000000000..c39b4a9a3b6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unexp_attribute.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR fortran/69498
+! This test used to result in an internal compiler error
+function f()
+ interface
+ external f ! { dg-error "Unexpected attribute declaration statement in INTERFACE" }
+ end interface
+end function