@@ -248,50 +248,67 @@ static bool warnByDefaultOnWrongCase(StringRef Include) {
248248
249249 // The standard C/C++ and Posix headers
250250 return llvm::StringSwitch<bool >(LowerInclude)
251- // C library headers
252- .Cases (" assert.h" , " complex.h" , " ctype.h" , " errno.h" , " fenv.h" , true )
253- .Cases (" float.h" , " inttypes.h" , " iso646.h" , " limits.h" , " locale.h" , true )
254- .Cases (" math.h" , " setjmp.h" , " signal.h" , " stdalign.h" , " stdarg.h" , true )
255- .Cases (" stdatomic.h" , " stdbool.h" , " stdckdint.h" , " stdcountof.h" , true )
256- .Cases (" stddef.h" , " stdint.h" , " stdio.h" , " stdlib.h" , " stdnoreturn.h" , true )
257- .Cases (" string.h" , " tgmath.h" , " threads.h" , " time.h" , " uchar.h" , true )
258- .Cases (" wchar.h" , " wctype.h" , true )
259-
260- // C++ headers for C library facilities
261- .Cases (" cassert" , " ccomplex" , " cctype" , " cerrno" , " cfenv" , true )
262- .Cases (" cfloat" , " cinttypes" , " ciso646" , " climits" , " clocale" , true )
263- .Cases (" cmath" , " csetjmp" , " csignal" , " cstdalign" , " cstdarg" , true )
264- .Cases (" cstdbool" , " cstddef" , " cstdint" , " cstdio" , " cstdlib" , true )
265- .Cases (" cstring" , " ctgmath" , " ctime" , " cuchar" , " cwchar" , true )
266- .Case (" cwctype" , true )
267-
268- // C++ library headers
269- .Cases (" algorithm" , " fstream" , " list" , " regex" , " thread" , true )
270- .Cases (" array" , " functional" , " locale" , " scoped_allocator" , " tuple" , true )
271- .Cases (" atomic" , " future" , " map" , " set" , " type_traits" , true )
272- .Cases (" bitset" , " initializer_list" , " memory" , " shared_mutex" , " typeindex" , true )
273- .Cases (" chrono" , " iomanip" , " mutex" , " sstream" , " typeinfo" , true )
274- .Cases (" codecvt" , " ios" , " new" , " stack" , " unordered_map" , true )
275- .Cases (" complex" , " iosfwd" , " numeric" , " stdexcept" , " unordered_set" , true )
276- .Cases (" condition_variable" , " iostream" , " ostream" , " streambuf" , " utility" , true )
277- .Cases (" deque" , " istream" , " queue" , " string" , " valarray" , true )
278- .Cases (" exception" , " iterator" , " random" , " strstream" , " vector" , true )
279- .Cases (" forward_list" , " limits" , " ratio" , " system_error" , true )
280-
281- // POSIX headers (which aren't also C headers)
282- .Cases (" aio.h" , " arpa/inet.h" , " cpio.h" , " dirent.h" , " dlfcn.h" , true )
283- .Cases (" fcntl.h" , " fmtmsg.h" , " fnmatch.h" , " ftw.h" , " glob.h" , true )
284- .Cases (" grp.h" , " iconv.h" , " langinfo.h" , " libgen.h" , " monetary.h" , true )
285- .Cases (" mqueue.h" , " ndbm.h" , " net/if.h" , " netdb.h" , " netinet/in.h" , true )
286- .Cases (" netinet/tcp.h" , " nl_types.h" , " poll.h" , " pthread.h" , " pwd.h" , true )
287- .Cases (" regex.h" , " sched.h" , " search.h" , " semaphore.h" , " spawn.h" , true )
288- .Cases (" strings.h" , " stropts.h" , " sys/ipc.h" , " sys/mman.h" , " sys/msg.h" , true )
289- .Cases (" sys/resource.h" , " sys/select.h" , " sys/sem.h" , " sys/shm.h" , " sys/socket.h" , true )
290- .Cases (" sys/stat.h" , " sys/statvfs.h" , " sys/time.h" , " sys/times.h" , " sys/types.h" , true )
291- .Cases (" sys/uio.h" , " sys/un.h" , " sys/utsname.h" , " sys/wait.h" , " syslog.h" , true )
292- .Cases (" tar.h" , " termios.h" , " trace.h" , " ulimit.h" , true )
293- .Cases (" unistd.h" , " utime.h" , " utmpx.h" , " wordexp.h" , true )
294- .Default (false );
251+ // C library headers
252+ .Cases ({" assert.h" , " complex.h" , " ctype.h" , " errno.h" , " fenv.h" }, true )
253+ .Cases ({" float.h" , " inttypes.h" , " iso646.h" , " limits.h" , " locale.h" },
254+ true )
255+ .Cases ({" math.h" , " setjmp.h" , " signal.h" , " stdalign.h" , " stdarg.h" }, true )
256+ .Cases ({" stdatomic.h" , " stdbool.h" , " stdckdint.h" , " stdcountof.h" }, true )
257+ .Cases ({" stddef.h" , " stdint.h" , " stdio.h" , " stdlib.h" , " stdnoreturn.h" },
258+ true )
259+ .Cases ({" string.h" , " tgmath.h" , " threads.h" , " time.h" , " uchar.h" }, true )
260+ .Cases ({" wchar.h" , " wctype.h" }, true )
261+
262+ // C++ headers for C library facilities
263+ .Cases ({" cassert" , " ccomplex" , " cctype" , " cerrno" , " cfenv" }, true )
264+ .Cases ({" cfloat" , " cinttypes" , " ciso646" , " climits" , " clocale" }, true )
265+ .Cases ({" cmath" , " csetjmp" , " csignal" , " cstdalign" , " cstdarg" }, true )
266+ .Cases ({" cstdbool" , " cstddef" , " cstdint" , " cstdio" , " cstdlib" }, true )
267+ .Cases ({" cstring" , " ctgmath" , " ctime" , " cuchar" , " cwchar" }, true )
268+ .Case (" cwctype" , true )
269+
270+ // C++ library headers
271+ .Cases ({" algorithm" , " fstream" , " list" , " regex" , " thread" }, true )
272+ .Cases ({" array" , " functional" , " locale" , " scoped_allocator" , " tuple" },
273+ true )
274+ .Cases ({" atomic" , " future" , " map" , " set" , " type_traits" }, true )
275+ .Cases (
276+ {" bitset" , " initializer_list" , " memory" , " shared_mutex" , " typeindex" },
277+ true )
278+ .Cases ({" chrono" , " iomanip" , " mutex" , " sstream" , " typeinfo" }, true )
279+ .Cases ({" codecvt" , " ios" , " new" , " stack" , " unordered_map" }, true )
280+ .Cases ({" complex" , " iosfwd" , " numeric" , " stdexcept" , " unordered_set" },
281+ true )
282+ .Cases (
283+ {" condition_variable" , " iostream" , " ostream" , " streambuf" , " utility" },
284+ true )
285+ .Cases ({" deque" , " istream" , " queue" , " string" , " valarray" }, true )
286+ .Cases ({" exception" , " iterator" , " random" , " strstream" , " vector" }, true )
287+ .Cases ({" forward_list" , " limits" , " ratio" , " system_error" }, true )
288+
289+ // POSIX headers (which aren't also C headers)
290+ .Cases ({" aio.h" , " arpa/inet.h" , " cpio.h" , " dirent.h" , " dlfcn.h" }, true )
291+ .Cases ({" fcntl.h" , " fmtmsg.h" , " fnmatch.h" , " ftw.h" , " glob.h" }, true )
292+ .Cases ({" grp.h" , " iconv.h" , " langinfo.h" , " libgen.h" , " monetary.h" }, true )
293+ .Cases ({" mqueue.h" , " ndbm.h" , " net/if.h" , " netdb.h" , " netinet/in.h" },
294+ true )
295+ .Cases ({" netinet/tcp.h" , " nl_types.h" , " poll.h" , " pthread.h" , " pwd.h" },
296+ true )
297+ .Cases ({" regex.h" , " sched.h" , " search.h" , " semaphore.h" , " spawn.h" }, true )
298+ .Cases ({" strings.h" , " stropts.h" , " sys/ipc.h" , " sys/mman.h" , " sys/msg.h" },
299+ true )
300+ .Cases ({" sys/resource.h" , " sys/select.h" , " sys/sem.h" , " sys/shm.h" ,
301+ " sys/socket.h" },
302+ true )
303+ .Cases ({" sys/stat.h" , " sys/statvfs.h" , " sys/time.h" , " sys/times.h" ,
304+ " sys/types.h" },
305+ true )
306+ .Cases (
307+ {" sys/uio.h" , " sys/un.h" , " sys/utsname.h" , " sys/wait.h" , " syslog.h" },
308+ true )
309+ .Cases ({" tar.h" , " termios.h" , " trace.h" , " ulimit.h" }, true )
310+ .Cases ({" unistd.h" , " utime.h" , " utmpx.h" , " wordexp.h" }, true )
311+ .Default (false );
295312}
296313
297314// / Find a similar string in `Candidates`.
0 commit comments