aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-06-10 19:59:23 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2021-06-10 20:19:39 +0200
commit5ae4a73057dd26e7f09b5ba5190b84b1bbea4368 (patch)
tree51bc8761d7715410f1e4b7e6a5ad4480ac3d9ab7 /gcc/testsuite/gdc.dg
parent7a895955095b6f4d9fcf3b6686dc1113591da28d (diff)
downloadgcc-5ae4a73057dd26e7f09b5ba5190b84b1bbea4368.zip
gcc-5ae4a73057dd26e7f09b5ba5190b84b1bbea4368.tar.gz
gcc-5ae4a73057dd26e7f09b5ba5190b84b1bbea4368.tar.bz2
d: Fix ICE in TypeInfoDeclaration, at dmd/declaration.c (PR100967)
Generate a stub TypeInfo class even if the root Object class is missing. The front-end will take care of issuing an error and abort the compilation when running semantic on constructed TypeInfo objects. The errors issued by the code generation pass relating to missing or disabled RTTI has been consolidated into a single function, so that a meaningful error will be emitted before the front-end terminates. gcc/d/ChangeLog: PR d/100967 * d-frontend.cc (getTypeInfoType): Move TypeInfo checks to check_typeinfo_type and call new function. * d-tree.h (check_typeinfo_type): Declare. * typeinfo.cc: Include dmd/scope.h. (create_frontend_tinfo_types): Generate front-end types even if Object is missing. (build_typeinfo): Move TypeInfo checks to check_typeinfo_type and call new function. (check_typeinfo_type): New function. gcc/testsuite/ChangeLog: PR d/100967 * gdc.dg/pr100967.d: New test.
Diffstat (limited to 'gcc/testsuite/gdc.dg')
-rw-r--r--gcc/testsuite/gdc.dg/pr100967.d11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.dg/pr100967.d b/gcc/testsuite/gdc.dg/pr100967.d
new file mode 100644
index 0000000..582ad58
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr100967.d
@@ -0,0 +1,11 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100967
+// { dg-do compile }
+
+module object; // { dg-error "class object.TypeInfo missing or corrupt object.d" }
+
+extern(C) int main()
+{
+ int[int] aa;
+ aa[0] = 1; // { dg-error ".object.TypeInfo. could not be found, but is implicitly used" }
+ return 0;
+}