1 // Test of -Wformat for subclasses of pp_element
3 // { dg-options "-Wformat" }
5 /* Magic identifiers must be set before the attribute is used. */
7 typedef long long __gcc_host_wide_int__;
9 typedef struct location_s
16 typedef union tree_node *tree;
18 /* Define gimple as a dummy type. The typedef must be provided for
19 the C test to find the symbol. */
20 typedef struct gimple gimple;
22 /* Likewise for gimple. */
23 typedef struct cgraph_node cgraph_node;
25 /* Likewise for diagnostic_event_id_t. */
26 typedef struct diagnostic_event_id_t diagnostic_event_id_t;
32 } // namespace pp_markup
33 typedef pp_markup::element pp_element;
35 #define FORMAT(kind) __attribute__ ((format (__gcc_## kind ##__, 1, 2)))
37 void diag (const char*, ...) FORMAT (diag);
39 class sub_element : public pp_element
43 class sub_sub_element : public sub_element
51 diag ("%e %e", &e1, &e2);