aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2007-08-19 22:08:14 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2007-08-19 22:08:14 +0200
commite9c06563626f034b29c8ccb35b01632a3fede753 (patch)
tree219c86311ab4522bd317eeca819f1b984e6769a3 /gcc/fortran/parse.c
parent434548f64ffd76cb2a8390935b2179d1a5a421e2 (diff)
downloadgcc-e9c06563626f034b29c8ccb35b01632a3fede753.zip
gcc-e9c06563626f034b29c8ccb35b01632a3fede753.tar.gz
gcc-e9c06563626f034b29c8ccb35b01632a3fede753.tar.bz2
[multiple changes]
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. From-SVN: r127626
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 40b2816..835b05a 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);