@@ -643,6 +643,7 @@ pure @safe:
643643 TypeDelegate
644644 TypeNone
645645 TypeVoid
646+ TypeNoreturn
646647 TypeByte
647648 TypeUbyte
648649 TypeShort
@@ -722,6 +723,9 @@ pure @safe:
722723 TypeVoid:
723724 v
724725
726+ TypeNoreturn
727+ Nn
728+
725729 TypeByte:
726730 g
727731
@@ -880,6 +884,10 @@ pure @safe:
880884 popFront();
881885 switch ( front )
882886 {
887+ case ' n' : // Noreturn
888+ popFront();
889+ put(" noreturn" );
890+ return dst[beg .. len];
883891 case ' g' : // Wild (Ng Type)
884892 popFront();
885893 // TODO: Anything needed here?
@@ -1171,9 +1179,11 @@ pure @safe:
11711179 case ' g' :
11721180 case ' h' :
11731181 case ' k' :
1182+ case ' n' :
11741183 // NOTE: The inout parameter type is represented as "Ng".
11751184 // The vector parameter type is represented as "Nh".
11761185 // The return parameter type is represented as "Nk".
1186+ // The noreturn parameter type is represented as "Nn".
11771187 // These make it look like a FuncAttr, but infact
11781188 // if we see these, then we know we're really in
11791189 // the parameter list. Rewind and break.
@@ -2690,6 +2700,25 @@ unittest
26902700 assert (s.demangle == expected);
26912701}
26922702
2703+ // https://issues.dlang.org/show_bug.cgi?id=22235
2704+ unittest
2705+ {
2706+ enum parent = __MODULE__ ~ ' .' ~ __traits(identifier, __traits(parent, {}));
2707+
2708+ static noreturn abort () { assert (false ); }
2709+ assert (demangle(abort.mangleof) == " pure nothrow @nogc @safe noreturn " ~ parent ~ " ().abort()" );
2710+
2711+ static void accept (noreturn) {}
2712+ assert (demangle(accept.mangleof) == " pure nothrow @nogc @safe void " ~ parent ~ " ().accept(noreturn)" );
2713+
2714+ static void templ (T)(T, T) {}
2715+ assert (demangle(templ! noreturn.mangleof) == " pure nothrow @nogc @safe void " ~ parent ~ " ().templ!(noreturn).templ(noreturn, noreturn)" );
2716+
2717+ static struct S (T) {}
2718+ static void aggr (S! noreturn) { assert (0 ); }
2719+ assert (demangle(aggr.mangleof) == " pure nothrow @nogc @safe void " ~ parent ~ " ().aggr(" ~ parent ~ " ().S!(noreturn).S)" );
2720+ }
2721+
26932722/*
26942723 *
26952724 */
0 commit comments