diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-06-26 09:57:21 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-06-26 09:57:21 -0700 |
commit | aa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch) | |
tree | 886212591b1c9d127eaaf234a4a2e22452ea384a /gcc/d/dmd/cppmangle.d | |
parent | 97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff) | |
parent | 3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff) | |
download | gcc-devel/gccgo.zip gcc-devel/gccgo.tar.gz gcc-devel/gccgo.tar.bz2 |
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'gcc/d/dmd/cppmangle.d')
-rw-r--r-- | gcc/d/dmd/cppmangle.d | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/d/dmd/cppmangle.d b/gcc/d/dmd/cppmangle.d index b015a64..32b3851 100644 --- a/gcc/d/dmd/cppmangle.d +++ b/gcc/d/dmd/cppmangle.d @@ -213,6 +213,11 @@ private final class CppMangleVisitor : Visitor { auto tf = cast(TypeFunction)this.context.res.asFuncDecl().type; Type rt = preSemantic.nextOf(); + // https://issues.dlang.org/show_bug.cgi?id=22739 + // auto return type means that rt is null. + // if so, just pick up the type from the instance + if (!rt) + rt = tf.nextOf(); if (tf.isref) rt = rt.referenceTo(); auto prev = this.context.push(tf.nextOf()); @@ -560,7 +565,11 @@ private final class CppMangleVisitor : Visitor foreach (j; i .. (*ti.tiargs).length) { Type t = isType((*ti.tiargs)[j]); - assert(t); + if (t is null) + { + ti.error("internal compiler error: C++ `%s` template value parameter is not supported", (*ti.tiargs)[j].toChars()); + fatal(); + } t.accept(this); } |