aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/class.cc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:38:33 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:38:33 +0100
commit4235574518bd016f208b97f6f497978c31771e12 (patch)
tree06362f23752d180e7ce4e6407787beba9634505c /gcc/fortran/class.cc
parent2cd7fb664ce9617c90b65b399423d330e1a78068 (diff)
parent0d9b4e8647ff01c3d3a782ab26684ca5a7c2f527 (diff)
downloadgcc-4235574518bd016f208b97f6f497978c31771e12.zip
gcc-4235574518bd016f208b97f6f497978c31771e12.tar.gz
gcc-4235574518bd016f208b97f6f497978c31771e12.tar.bz2
Merge commit '46595ce72e5855189e3c60a140c3ca5aaddfb58c^' into HEAD
Diffstat (limited to 'gcc/fortran/class.cc')
-rw-r--r--gcc/fortran/class.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/class.cc b/gcc/fortran/class.cc
index 9d0c802..5c43b77 100644
--- a/gcc/fortran/class.cc
+++ b/gcc/fortran/class.cc
@@ -647,6 +647,10 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
gcc_assert (as);
+ /* We cannot build the class container now. */
+ if (attr->class_ok && (!ts->u.derived || !ts->u.derived->components))
+ return false;
+
/* Class container has already been built with same name. */
if (attr->class_ok
&& ts->u.derived->components->attr.dimension >= attr->dimension