* fix #14369

* empty commit
This commit is contained in:
cooldome 2020-05-18 08:38:36 +01:00 • committed by GitHub
commit bc42e9aa98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -727,6 +727,7 @@ proc genRaiseStmt(p: BProc, t: PNode) =
initLocExprSingleUse(p, t[0], a) initLocExprSingleUse(p, t[0], a)
finallyActions(p) finallyActions(p)
var e = rdLoc(a) var e = rdLoc(a)
discard getTypeDesc(p.module, t[0].typ)
var typ = skipTypes(t[0].typ, abstractPtrs) var typ = skipTypes(t[0].typ, abstractPtrs)
# XXX For reasons that currently escape me, this is only required by the new # XXX For reasons that currently escape me, this is only required by the new
# C++ based exception handling: # C++ based exception handling:

View file

@ -0,0 +1,10 @@
discard """
targets: "cpp"
output: ""
"""
#issue #14369 case 2
type RuntimeError {.requiresInit, importcpp: "std::runtime_error", header: "<stdexcept>".} = object
proc initRuntimeError(a: cstring): RuntimeError {.importcpp: "std::runtime_error(@)", constructor.}
try: raise initRuntimeError("foo2")
except: discard