// RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers -- -std=c++11 -v #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers] // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'complex.h'; consider using 'complex' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'ctype.h'; consider using 'cctype' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'errno.h'; consider using 'cerrno' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'fenv.h'; consider using 'cfenv' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'float.h'; consider using 'cfloat' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'inttypes.h'; consider using 'cinttypes' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'limits.h'; consider using 'climits' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'locale.h'; consider using 'clocale' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'setjmp.h'; consider using 'csetjmp' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'signal.h'; consider using 'csignal' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdarg.h'; consider using 'cstdarg' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stddef.h'; consider using 'cstddef' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdint.h'; consider using 'cstdint' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdlib.h'; consider using 'cstdlib' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'string.h'; consider using 'cstring' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'tgmath.h'; consider using 'ctgmath' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'time.h'; consider using 'ctime' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'uchar.h'; consider using 'cuchar' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'wchar.h'; consider using 'cwchar' instead // CHECK-FIXES: {{^}}#include {{$}} #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'wctype.h'; consider using 'cwctype' instead // CHECK-FIXES: {{^}}#include // Headers that have no effect in C++; remove them #include // // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdalign.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// {{$}} #include // // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdbool.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// {{$}} #include // // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'iso646.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// {{$}} #include "assert.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead // CHECK-FIXES: {{^}}#include {{$}} #include "complex.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'complex.h'; consider using 'complex' instead // CHECK-FIXES: {{^}}#include {{$}} #include "ctype.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'ctype.h'; consider using 'cctype' instead // CHECK-FIXES: {{^}}#include {{$}} #include "errno.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'errno.h'; consider using 'cerrno' instead // CHECK-FIXES: {{^}}#include {{$}} #include "fenv.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'fenv.h'; consider using 'cfenv' instead // CHECK-FIXES: {{^}}#include {{$}} #include "float.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'float.h'; consider using 'cfloat' instead // CHECK-FIXES: {{^}}#include {{$}} #include "inttypes.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'inttypes.h'; consider using 'cinttypes' instead // CHECK-FIXES: {{^}}#include {{$}} #include "limits.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'limits.h'; consider using 'climits' instead // CHECK-FIXES: {{^}}#include {{$}} #include "locale.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'locale.h'; consider using 'clocale' instead // CHECK-FIXES: {{^}}#include {{$}} #include "math.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead // CHECK-FIXES: {{^}}#include {{$}} #include "setjmp.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'setjmp.h'; consider using 'csetjmp' instead // CHECK-FIXES: {{^}}#include {{$}} #include "signal.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'signal.h'; consider using 'csignal' instead // CHECK-FIXES: {{^}}#include {{$}} #include "stdarg.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdarg.h'; consider using 'cstdarg' instead // CHECK-FIXES: {{^}}#include {{$}} #include "stddef.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stddef.h'; consider using 'cstddef' instead // CHECK-FIXES: {{^}}#include {{$}} #include "stdint.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdint.h'; consider using 'cstdint' instead // CHECK-FIXES: {{^}}#include {{$}} #include "stdio.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead // CHECK-FIXES: {{^}}#include {{$}} #include "stdlib.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'stdlib.h'; consider using 'cstdlib' instead // CHECK-FIXES: {{^}}#include {{$}} #include "string.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'string.h'; consider using 'cstring' instead // CHECK-FIXES: {{^}}#include {{$}} #include "tgmath.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'tgmath.h'; consider using 'ctgmath' instead // CHECK-FIXES: {{^}}#include {{$}} #include "time.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'time.h'; consider using 'ctime' instead // CHECK-FIXES: {{^}}#include {{$}} #include "uchar.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'uchar.h'; consider using 'cuchar' instead // CHECK-FIXES: {{^}}#include {{$}} #include "wchar.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'wchar.h'; consider using 'cwchar' instead // CHECK-FIXES: {{^}}#include {{$}} #include "wctype.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'wctype.h'; consider using 'cwctype' instead // CHECK-FIXES: {{^}}#include // Headers that have no effect in C++; remove them #include "stdalign.h" // "stdalign.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdalign.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// "stdalign.h"{{$}} #include "stdbool.h" // "stdbool.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdbool.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// "stdbool.h"{{$}} #include "iso646.h" // "iso646.h" // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'iso646.h' has no effect in C++; consider removing it // CHECK-FIXES: {{^}}// "iso646.h"{{$}}