Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
52354dad
Commit
52354dad
authored
Jan 16, 2020
by
Thomas König
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for illegal reference in function.
parent
2589beb1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
0 deletions
+42
-0
gcc/fortran/ChangeLog
+7
-0
gcc/fortran/primary.c
+1
-0
gcc/fortran/resolve.c
+7
-0
gcc/testsuite/ChangeLog
+6
-0
gcc/testsuite/gfortran.dg/function_reference_1.f90
+11
-0
gcc/testsuite/gfortran.dg/function_reference_2.f90
+10
-0
No files found.
gcc/fortran/ChangeLog
View file @
52354dad
2020-01-19 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/44960
* primary.c (gfc_match_rvalue): Break after setting MATCH_ERROR.
* resolve.c (resolve_function): Issue error when a
function call contains a reference.
2020-01-17 Mark Eggleston <mark.eggleston@codethink.com>
PR fortran/93236
...
...
gcc/fortran/primary.c
View file @
52354dad
...
...
@@ -3661,6 +3661,7 @@ gfc_match_rvalue (gfc_expr **result)
gfc_error
(
"The leftmost part-ref in a data-ref cannot be a "
"function reference at %C"
);
m
=
MATCH_ERROR
;
break
;
}
m
=
MATCH_YES
;
...
...
gcc/fortran/resolve.c
View file @
52354dad
...
...
@@ -3129,6 +3129,13 @@ resolve_function (gfc_expr *expr)
||
sym
->
intmod_sym_id
==
GFC_ISYM_CAF_SEND
))
return
true
;
if
(
expr
->
ref
)
{
gfc_error
(
"Unexpected junk after %qs at %L"
,
expr
->
symtree
->
n
.
sym
->
name
,
&
expr
->
where
);
return
false
;
}
if
(
sym
&&
sym
->
attr
.
intrinsic
&&
!
gfc_resolve_intrinsic
(
sym
,
&
expr
->
where
))
return
false
;
...
...
gcc/testsuite/ChangeLog
View file @
52354dad
2020-01-19 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/44960
* gfortran.dg/function_reference_1.f90: New test.
* gfortran.dg/function_reference_2.f90: New test.
2020-01-18 Jakub Jelinek <jakub@redhat.com>
PR c/92833
...
...
gcc/testsuite/gfortran.dg/function_reference_1.f90
0 → 100644
View file @
52354dad
! { dg-do compile }
! PR 44960 - this was erroneusly accepted.
! Original test case by Daniel Franke.
type
t
integer
::
a
end
type
t
type
(
t
)
::
foo
print
*
,
foo
(
1
)
%
a
! { dg-error "Unexpected junk" }
end
gcc/testsuite/gfortran.dg/function_reference_2.f90
0 → 100644
View file @
52354dad
! { dg-do compile }
! PR 44960 - improve the error message
program
main
type
t
integer
::
a
end
type
t
type
(
t
)
::
foo
external
foo
i
=
foo
(
1
)
%
1
! { dg-error "leftmost part-ref in a data-ref cannot be a function reference" }
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment