1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-show-caret" } */
4 typedef struct GtkWidget { int dummy; } GtkWidget;
6 extern void gtk_widget_show_all (GtkWidget *w);
12 gtk_widget_showall (w); // { dg-error "3: 'gtk_widget_showall' was not declared in this scope" }
13 /* { dg-begin-multiline-output "" }
14 gtk_widget_showall (w);
16 { dg-end-multiline-output "" } */
17 // { dg-message "3: suggested alternative: 'gtk_widget_show_all'" "" { target *-*-* } 12 }
18 /* { dg-begin-multiline-output "" }
19 gtk_widget_showall (w);
22 { dg-end-multiline-output "" } */
24 /* Ensure we don't try to suggest "gtk_widget_showall" for subsequent
26 gtk_widget_showall_ (w); // { dg-error "3: 'gtk_widget_showall_' was not declared in this scope" }
27 /* { dg-begin-multiline-output "" }
28 gtk_widget_showall_ (w);
30 { dg-end-multiline-output "" } */
31 // { dg-message "3: suggested alternative: 'gtk_widget_show_all'" "" { target *-*-* } 26 }
32 /* { dg-begin-multiline-output "" }
33 gtk_widget_showall_ (w);
36 { dg-end-multiline-output "" } */
38 GtkWidgetShowAll (w); // { dg-error "3: 'GtkWidgetShowAll' was not declared in this scope" }
39 /* { dg-begin-multiline-output "" }
42 { dg-end-multiline-output "" } */
43 // { dg-message "3: suggested alternative: 'gtk_widget_show_all'" "" { target *-*-* } 38 }
44 /* { dg-begin-multiline-output "" }
48 { dg-end-multiline-output "" } */
54 return parma * parma; // { dg-error "10: 'parma' was not declared in this scope" }
55 /* { dg-begin-multiline-output "" }
58 { dg-end-multiline-output "" } */
59 // { dg-message "10: suggested alternative: 'param'" "" { target *-*-* } 54 }
60 /* { dg-begin-multiline-output "" }
64 { dg-end-multiline-output "" } */
67 #define MACRO(X) ((X))
72 return MACRAME (i); // { dg-error "10: 'MACRAME' was not declared in this scope" }
73 /* { dg-begin-multiline-output "" }
76 { dg-end-multiline-output "" } */
77 // { dg-message "10: suggested alternative: 'MACRO'" "" { target *-*-* } 72 }
78 /* { dg-begin-multiline-output "" }
82 { dg-end-multiline-output "" } */
85 #define IDENTIFIER_POINTER(X) ((X))
90 return IDENTIFIER_PTR (node); // { dg-error "10: 'IDENTIFIER_PTR' was not declared in this scope" }
91 /* { dg-begin-multiline-output "" }
92 return IDENTIFIER_PTR (node);
94 { dg-end-multiline-output "" } */
95 // { dg-message "10: suggested alternative: 'IDENTIFIER_POINTER'" "" { target *-*-* } 90 }
96 /* { dg-begin-multiline-output "" }
97 return IDENTIFIER_PTR (node);
100 { dg-end-multiline-output "" } */
107 return __LINE_; /* { dg-error "10: '__LINE_' was not declared in this scope" }
108 /* { dg-begin-multiline-output "" }
111 { dg-end-multiline-output "" } */
112 // { dg-message "10: suggested alternative: '__LINE__'" "" { target *-*-* } 107 }
113 /* { dg-begin-multiline-output "" }
117 { dg-end-multiline-output "" } */
120 #define MAX_ITEMS 100
121 int array[MAX_ITEM]; // { dg-error "11: 'MAX_ITEM' was not declared in this scope" }
122 /* { dg-begin-multiline-output "" }
125 { dg-end-multiline-output "" } */
126 // { dg-message "11: suggested alternative: 'MAX_ITEMS'" "" { target *-*-* } 121 }
127 /* { dg-begin-multiline-output "" }
131 { dg-end-multiline-output "" } */
144 case FOO_FURST: // { dg-error "10: 'FOO_FURST' was not declared in this scope" }
146 /* { dg-begin-multiline-output "" }
149 { dg-end-multiline-output "" } */
150 // { dg-message "10: suggested alternative: 'FOO_FIRST'" "" { target *-*-* } 144 }
151 /* { dg-begin-multiline-output "" }
155 { dg-end-multiline-output "" } */
157 case FOO_SECCOND: // { dg-error "10: 'FOO_SECCOND' was not declared in this scope" }
159 /* { dg-begin-multiline-output "" }
162 { dg-end-multiline-output "" } */
163 // { dg-message "10: suggested alternative: 'FOO_SECOND'" "" { target *-*-* } 157 }
164 /* { dg-begin-multiline-output "" }
168 { dg-end-multiline-output "" } */
175 int snprintf (char *, __SIZE_TYPE__, const char *, ...);
178 test_7 (int i, int j)
181 snprint (buffer, 100, "%i of %i", i, j); // { dg-error "3: 'snprint' was not declared in this scope" }
182 /* { dg-begin-multiline-output "" }
183 snprint (buffer, 100, "%i of %i", i, j);
185 { dg-end-multiline-output "" } */
186 // { dg-message "3: suggested alternative: 'snprintf'" "" { target *-*-* } 181 }
187 /* { dg-begin-multiline-output "" }
188 snprint (buffer, 100, "%i of %i", i, j);
191 { dg-end-multiline-output "" } */
199 return locale; // { dg-error "10: 'locale' was not declared in this scope" }
200 /* { dg-begin-multiline-output "" }
203 { dg-end-multiline-output "" } */
204 // { dg-message "10: suggested alternative: 'local'" "" { target *-*-* } 199 }
205 /* { dg-begin-multiline-output "" }
209 { dg-end-multiline-output "" } */
215 int test_method_1 ();
221 class sub : public base
224 int test_method_2 ();
227 int base::test_method_1 ()
229 return m_food; // { dg-error "10: 'm_food' was not declared in this scope" }
230 /* { dg-begin-multiline-output "" }
233 { dg-end-multiline-output "" } */
234 // { dg-message "10: suggested alternative: 'm_foo'" "" { target *-*-* } 229 }
235 /* { dg-begin-multiline-output "" }
239 { dg-end-multiline-output "" } */
242 int sub::test_method_2 ()
244 return m_food; // { dg-error "10: 'm_food' was not declared in this scope" }
245 /* { dg-begin-multiline-output "" }
248 { dg-end-multiline-output "" } */
249 // { dg-message "10: suggested alternative: 'm_foo'" "" { target *-*-* } 244 }
250 /* { dg-begin-multiline-output "" }
254 { dg-end-multiline-output "" } */