* fix #17351; switch to c++17 * remove workaround
This commit is contained in:
parent
be4bd8a0ed
commit
47b59e4d33
3 changed files with 14 additions and 5 deletions
|
|
@ -376,8 +376,7 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: var TLoc,
|
||||||
else:
|
else:
|
||||||
linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfoV1(p.module, t, a.lode.info)])
|
linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfoV1(p.module, t, a.lode.info)])
|
||||||
of frEmbedded:
|
of frEmbedded:
|
||||||
# inheritance in C++ does not allow struct initialization: bug #18410
|
if optTinyRtti in p.config.globalOptions:
|
||||||
if not p.module.compileToCpp and optTinyRtti in p.config.globalOptions:
|
|
||||||
var tmp: TLoc
|
var tmp: TLoc
|
||||||
if mode == constructRefObj:
|
if mode == constructRefObj:
|
||||||
let objType = t.skipTypes(abstractInst+{tyRef})
|
let objType = t.skipTypes(abstractInst+{tyRef})
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ compiler gcc:
|
||||||
asmStmtFrmt: "__asm__($1);$n",
|
asmStmtFrmt: "__asm__($1);$n",
|
||||||
structStmtFmt: "$1 $3 $2 ", # struct|union [packed] $name
|
structStmtFmt: "$1 $3 $2 ", # struct|union [packed] $name
|
||||||
produceAsm: gnuAsmListing,
|
produceAsm: gnuAsmListing,
|
||||||
cppXsupport: "-std=gnu++14 -funsigned-char",
|
cppXsupport: "-std=gnu++17 -funsigned-char",
|
||||||
props: {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasGnuAsm,
|
props: {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasGnuAsm,
|
||||||
hasAttribute})
|
hasAttribute})
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ compiler nintendoSwitchGCC:
|
||||||
asmStmtFrmt: "asm($1);$n",
|
asmStmtFrmt: "asm($1);$n",
|
||||||
structStmtFmt: "$1 $3 $2 ", # struct|union [packed] $name
|
structStmtFmt: "$1 $3 $2 ", # struct|union [packed] $name
|
||||||
produceAsm: gnuAsmListing,
|
produceAsm: gnuAsmListing,
|
||||||
cppXsupport: "-std=gnu++14 -funsigned-char",
|
cppXsupport: "-std=gnu++17 -funsigned-char",
|
||||||
props: {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasGnuAsm,
|
props: {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasGnuAsm,
|
||||||
hasAttribute})
|
hasAttribute})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,13 @@ type
|
||||||
proc p(): Option[O] = none(O)
|
proc p(): Option[O] = none(O)
|
||||||
|
|
||||||
doAssert $p() == "none(O)"
|
doAssert $p() == "none(O)"
|
||||||
|
|
||||||
|
# bug #17351
|
||||||
|
type
|
||||||
|
Foo = object of RootObj
|
||||||
|
Foo2 = object of Foo
|
||||||
|
Bar = object
|
||||||
|
x: Foo2
|
||||||
|
|
||||||
|
var b = Bar()
|
||||||
|
discard b
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue