+2017-01-18 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79091
+ * mangle.c (write_exception_spec): Check nothrow explicitly.
+ (write_encoding): Don't increment processing_template_decl around
+ encoding.
+
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/70182
return;
}
- if (nothrow_spec_p (spec))
+ if (spec == noexcept_true_spec || spec == empty_except_spec)
write_string ("Do");
- else if (TREE_PURPOSE (spec))
+ else if (tree expr = TREE_PURPOSE (spec))
{
- gcc_assert (uses_template_parms (TREE_PURPOSE (spec)));
+ /* noexcept (expr) */
+ gcc_assert (uses_template_parms (expr));
write_string ("DO");
- write_expression (TREE_PURPOSE (spec));
+ write_expression (expr);
write_char ('E');
}
else
{
+ /* throw (type-list) */
write_string ("Dw");
for (tree t = spec; t; t = TREE_CHAIN (t))
write_type (TREE_VALUE (t));
if (tmpl)
{
- ++processing_template_decl;
fn_type = get_mostly_instantiated_function_type (decl);
/* FN_TYPE will not have parameter types for in-charge or
VTT parameters. Therefore, we pass NULL_TREE to
write_bare_function_type (fn_type,
mangle_return_type_p (decl),
d);
-
- if (tmpl)
- --processing_template_decl;
}
}
+2017-01-18 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79091
+ * g++.dg/pr79091.C: New.
+
2017-01-17 Joe Seymour <joe.s@somniumtech.com>
* gcc.target/msp430/mul_f5_muldef.c: New test.
--- /dev/null
+// PR 79091 ICE mangling an unnamed enum in a tempate instantiation.
+
+enum {
+ One = 1
+};
+
+template<int Options>
+class Matrix {};
+
+template<int Dim>
+Matrix<Dim ? One : 0> *Bar ()
+{
+ return 0;
+}
+
+template<int Opt>
+Matrix<Opt> *Baz ()
+{
+ return 0;
+}
+
+bool Foo ()
+{
+ return Baz<1> () == Bar<1> ();
+}