+2017-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * d-demangle.c (dlang_identifier): Handle template constraint symbols.
+ (dlang_parse_template): Only advance if template symbol prefix is
+ followed by a digit.
+ * testsuite/d-demangle-expected: Add tests.
+
2017-05-01 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_attributes): Handle scope attributes.
mangled = endptr;
/* May be a template instance. */
- if (len >= 5 && strncmp (mangled, "__T", 3) == 0)
- {
- /* Template symbol. */
- if (ISDIGIT (mangled[3]) && mangled[3] != '0')
- return dlang_parse_template (decl, mangled, len);
-
- return NULL;
- }
+ if (len >= 5 && mangled[0] == '_' && mangled[1] == '_'
+ && (mangled[2] == 'T' || mangled[2] == 'U'))
+ return dlang_parse_template (decl, mangled, len);
switch (len)
{
TemplateInstanceName:
Number __T LName TemplateArgs Z
+ Number __U LName TemplateArgs Z
^
The start pointer should be at the above location, and LEN should be
the value of the decoded number.
*/
- if (strncmp (mangled, "__T", 3) != 0)
+
+ /* Template symbol. */
+ if (!ISDIGIT (mangled[3]) || mangled[3] == '0')
return NULL;
mangled += 3;