1 // Test of -Wformat for subclasses of pp_element
3 // { dg-options "-Wformat" }
6 typedef union tree_node *tree;
13 } // namespace pp_markup
15 typedef pp_markup::element pp_element;
17 extern void error_at (rich_location *, const char *, ...)
18 __attribute__ ((__format__ (__gcc_cdiag__, 2, 3),
21 namespace highlight_colors {
23 extern const char *const lhs;
24 extern const char *const rhs;
26 } // namespace highlight_colors
30 class element_quoted_type : public element
33 element_quoted_type (tree type, const char *highlight_color)
35 m_highlight_color (highlight_color)
40 const char *m_highlight_color;
46 binary_op_error (rich_location *richloc, const char *opname,
47 tree type0, tree type1)
49 pp_markup::element_quoted_type element_0 (type0, highlight_colors::lhs);
50 pp_markup::element_quoted_type element_1 (type1, highlight_colors::rhs);
52 "invalid operands to binary %s (have %e and %e)",
53 opname, &element_0, &element_1);