]> gcc.gnu.org Git - gcc.git/commit
d: Fix ICE in TypeInfoDeclaration, at dmd/declaration.c (PR100967)
authorIain Buclaw <ibuclaw@gdcproject.org>
Thu, 10 Jun 2021 17:59:23 +0000 (19:59 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 10 Jun 2021 18:25:12 +0000 (20:25 +0200)
commit06b794846f1d8fa55133a257f6d7af39398b9cdc
treedd80c25da0c0ea55af4961eb79dc3638ad026aca
parenta037725e3f66e2db534222a49289ed4a1ed48031
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.

(cherry picked from commit 5ae4a73057dd26e7f09b5ba5190b84b1bbea4368)
gcc/d/d-frontend.cc
gcc/d/d-tree.h
gcc/d/typeinfo.cc
gcc/testsuite/gdc.dg/pr100967.d [new file with mode: 0644]
This page took 0.059414 seconds and 6 git commands to generate.