[multiple changes]
authorDaniel Kraft <d@domob.eu>
Sat, 12 Jul 2008 11:26:50 +0000 (13:26 +0200)
committerDaniel Kraft <domob@gcc.gnu.org>
Sat, 12 Jul 2008 11:26:50 +0000 (13:26 +0200)
2008-07-12  Daniel Kraft  <d@domob.eu>

* resolve.c (resolve_fl_derived):  Allow pointer components to empty
derived types fixing a missing part of PR fortran/33221.

2008-06-22  Daniel Kraft  <d@domob.eu>

* gfortran.dg/used_types_21.f90:  New test.

From-SVN: r137737

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/used_types_21.f90 [new file with mode: 0644]

index d8c31145d98b8245a7dc23e1df15c6a6ee161ba0..d79a72e73ec8c3d304f6f7c0df53cfe3b0b9378b 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-12  Daniel Kraft  <d@domob.eu>
+
+       * resolve.c (resolve_fl_derived):  Allow pointer components to empty
+       derived types fixing a missing part of PR fortran/33221.
+
 2008-07-10  Daniel Kraft  <d@domob.eu>
 
        * gfc-internals.texi (section gfc_expr):  Created documentation about
index c0ec7847747ca57d1c3dde495f68ede6b71fb0a8..273f2ae746be6f7d17f19f2fb5595b047159477e 100644 (file)
@@ -7657,7 +7657,8 @@ resolve_fl_derived (gfc_symbol *sym)
        }
 
       if (c->ts.type == BT_DERIVED && c->pointer
-         && c->ts.derived->components == NULL)
+         && c->ts.derived->components == NULL
+         && !c->ts.derived->attr.zero_comp)
        {
          gfc_error ("The pointer component '%s' of '%s' at %L is a type "
                     "that has not been declared", c->name, sym->name,
index c246c5f6aec2d18ded80ccf6a81712214d25c9dd..0b1bc9777183c803df6fda8f792b3ef5db39285d 100644 (file)
@@ -1,3 +1,7 @@
+2008-06-22  Daniel Kraft  <d@domob.eu>
+
+       * gfortran.dg/used_types_21.f90:  New test.
+
 2008-07-11  Ian Lance Taylor  <iant@google.com>
 
        * gcc.dg/Wcxx-compat-2.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/used_types_21.f90 b/gcc/testsuite/gfortran.dg/used_types_21.f90
new file mode 100644 (file)
index 0000000..04b109f
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! Check that pointer components are allowed to empty types.
+
+TYPE :: empty_t
+END TYPE empty_t
+
+TYPE :: comp_t
+  TYPE(empty_t), POINTER :: ptr
+END TYPE comp_t
+
+END