summaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-19 20:08:14 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-19 20:08:14 +0000
commita305543185071bc945b42c82339c7fe3952aa160 (patch)
tree219c86311ab4522bd317eeca819f1b984e6769a3 /gcc/fortran/parse.c
parent4726380a9a5370bcfed33691afe1e60a788ac455 (diff)
downloadgcc-a305543185071bc945b42c82339c7fe3952aa160.tar.gz
2007-08-18 Tobias Burnus <burnus@net-b.de>
* gfortran.h (gfc_is_intrinsic_typename): Add declaration. * symbol.c (gfc_is_intrinsic_typename): New function. * parse.c (decode_statement): Check for space in ABSTRACT INTERFACE. (parse_interface): Use gfc_is_intrinsic_typename. * decl.c (gfc_match_derived_decl): Ditto. * module.c (gfc_match_use): Use gcc_unreachable() for INTERFACE_ABSTRACT in switch(). 2007-08-19 Tobias Burnus <burnus@net-b.de> * gfortran.dg/interface_abstract_2.f90: New. * gfortran.dg/interface_abstract_1.f90: Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127626 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 40b2816c62d..835b05a97e2 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -172,7 +172,8 @@ decode_statement (void)
switch (c)
{
case 'a':
- match ("abstract interface", gfc_match_abstract_interface, ST_INTERFACE);
+ match ("abstract% interface", gfc_match_abstract_interface,
+ ST_INTERFACE);
match ("allocate", gfc_match_allocate, ST_ALLOCATE);
match ("allocatable", gfc_match_allocatable, ST_ATTR_DECL);
match ("assign", gfc_match_assign, ST_LABEL_ASSIGNMENT);
@@ -1799,13 +1800,10 @@ loop:
if (current_interface.type == INTERFACE_ABSTRACT)
{
gfc_new_block->attr.abstract = 1;
- if (!strcmp(gfc_new_block->name,"integer")
- || !strcmp(gfc_new_block->name,"real")
- || !strcmp(gfc_new_block->name,"complex")
- || !strcmp(gfc_new_block->name,"character")
- || !strcmp(gfc_new_block->name,"logical"))
- gfc_error ("Name of ABSTRACT INTERFACE at %C cannot be the same as "
- "an intrinsic type: %s",gfc_new_block->name);
+ if (gfc_is_intrinsic_typename (gfc_new_block->name))
+ gfc_error ("Name '%s' of ABSTRACT INTERFACE at %C "
+ "cannot be the same as an intrinsic type",
+ gfc_new_block->name);
}
push_state (&s2, new_state, gfc_new_block);