aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/cppmangle.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/cppmangle.d')
-rw-r--r--gcc/d/dmd/cppmangle.d11
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);
}