}
}
+ // Special case: "]^" are the first characters.
+ if (I + 1 != E && I[0] == '^' && I[1] == ']') {
+ I += 2;
+ if (I == E) {
+ H.HandleIncompleteScanList(start, I - 1);
+ return true;
+ }
+ }
+
// Look for a ']' character which denotes the end of the scan list.
while (*I != ']') {
if (++I == E) {
scanf("%h[abc]", sp); // expected-warning{{length modifier 'h' results in undefined behavior or no effect with '[' conversion specifier}}
scanf("%l[xyx]", ls); // no-warning
scanf("%ll[xyx]", ls); // expected-warning {{length modifier 'll' results in undefined behavior or no effect with '[' conversion specifier}}
+
+ // PR19559
+ scanf("%[]% ]", sp); // no-warning
+ scanf("%[^]% ]", sp); // no-warning
+ scanf("%[a^]% ]", sp); // expected-warning {{invalid conversion specifier ' '}}
}
void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {