else
write_string ("tr");
}
+ else if (code == NOEXCEPT_EXPR)
+ {
+ write_string ("nx");
+ write_expression (TREE_OPERAND (expr, 0));
+ }
else if (code == CONSTRUCTOR)
{
bool braced_init = BRACE_ENCLOSED_INITIALIZER_P (expr);
--- /dev/null
+// PR c++/70790
+// { dg-do compile { target c++11 } }
+
+template<bool B>
+struct A { };
+
+template<class T>
+void f(A<noexcept(T{})>);
+
+int main() {
+ f<int>({});
+}
+
+// { dg-final { scan-assembler "_Z1fIiEv1AIXnxtlT_EEE" } }
{ "ng", NL ("-"), 1 },
{ "nt", NL ("!"), 1 },
{ "nw", NL ("new"), 3 },
+ { "nx", NL ("noexcept"), 1 },
{ "oR", NL ("|="), 2 },
{ "oo", NL ("||"), 2 },
{ "or", NL ("|"), 2 },
if (code && !strcmp (code, "gs"))
/* Avoid parens after '::'. */
d_print_comp (dpi, options, operand);
- else if (code && !strcmp (code, "st"))
- /* Always print parens for sizeof (type). */
+ else if (code && (!strcmp (code, "st") || !strcmp (code, "nx")))
+ /* Always print parens for sizeof (type) and noexcept(expr). */
{
d_append_char (dpi, '(');
d_print_comp (dpi, options, operand);