]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/60526 (Accepts-invalid: Variable name same as type name)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 14 Feb 2016 15:13:39 +0000 (15:13 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 14 Feb 2016 15:13:39 +0000 (15:13 +0000)
2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/60526
PR bootstrap/69816
* decl.c (build_sym):  Reverted previous patch.

2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/60526
PR bootstrap/69816
* gfortran.dg/type_decl_4.f90:  Removed.

From-SVN: r233411

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/type_decl_4.f90 [deleted file]

index 5ef62ae57e36426df70ec9b5955783a66f2ab47d..aa4a0288ee00e9f1d7e3afc674985bffd7b0e01a 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/60526
+       PR bootstrap/69816
+       * decl.c (build_sym):  Reverted previous patch.
+
 2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/60526
index a31ea490bcf8bf38caebdfd563a33604fb8f9332..df813697a0251389e4b4611f75cd63e6648d1441 100644 (file)
@@ -1215,30 +1215,10 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
 {
   symbol_attribute attr;
   gfc_symbol *sym;
-  int nlen;
-  char u_name[GFC_MAX_SYMBOL_LEN + 1];
-  gfc_symtree *st;
 
   if (gfc_get_symbol (name, NULL, &sym))
     return false;
 
-  /* Check if the name has already been defined as a type.  The
-     first letter of the symtree will be in upper case then.  */
-
-  nlen = strlen(name);
-  gcc_assert (nlen <= GFC_MAX_SYMBOL_LEN);
-  strncpy (u_name, name, nlen + 1);
-  u_name[0] = TOUPPER(u_name[0]);
-
-  st = gfc_find_symtree (gfc_current_ns->sym_root, u_name);
-
-  if (st != 0)
-    {
-      gfc_error ("Symbol %qs at %C also declared as a type at %L", name,
-                &st->n.sym->declared_at);
-      return false;
-    }
-
   /* Start updating the symbol table.  Add basic type attribute if present.  */
   if (current_ts.type != BT_UNKNOWN
       && (sym->attr.implicit_type == 0
index 4b494b13717edbaec542f9a9f2c9772ae96aa2d3..cc9e002648289f90cda6c8e1405b89bdad00e69e 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/60526
+       PR bootstrap/69816
+       * gfortran.dg/type_decl_4.f90:  Removed.
+
 2016-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/60526
diff --git a/gcc/testsuite/gfortran.dg/type_decl_4.f90 b/gcc/testsuite/gfortran.dg/type_decl_4.f90
deleted file mode 100644 (file)
index 5c3ddb8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-! { dg-do compile }
-program main
-  type Xx ! { dg-error "Symbol 'xx' at .1. also declared as a type at .2." }
-  end type Xx
-  real :: Xx  ! { dg-error "Symbol 'xx' at .1. also declared as a type at .2." }
-  
-end program main