diff options
author | flywind <xzsflywind@gmail.com> | 2021-10-31 13:22:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 06:22:00 +0100 |
commit | 2f730afe9e7eb981258aea257deba0240f488dd1 (patch) | |
tree | 6e0adc83014fa80c07a56e5877e80612aa48f731 /compiler | |
parent | 2bda4a30a6b12dd0840dc347e454e54fe26721e7 (diff) | |
download | Nim-2f730afe9e7eb981258aea257deba0240f488dd1.tar.gz |
fix #18410 (Errors initializing an object of RootObj with the C++ backend) [backport] (#18836)
* fix #18410 * one line comment * typo * typo * cover cpp
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cgen.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 412a428da..b669483cc 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -363,7 +363,8 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: var TLoc, else: linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfoV1(p.module, t, a.lode.info)]) of frEmbedded: - if optTinyRtti in p.config.globalOptions: + # inheritance in C++ does not allow struct initialization: bug #18410 + if not p.module.compileToCpp and optTinyRtti in p.config.globalOptions: var tmp: TLoc if mode == constructRefObj: let objType = t.skipTypes(abstractInst+{tyRef}) |