llvm-project/clang/test/Index/fixit-sysheader-test.cpp
Fahad Nayyar 5e5d901feb [Clang] [Sema] Removed a fix-it for system headers
Disabled an invalid fix-it which suggested fixes to be applied in system headers for some programs in IDEs like Xcode.

rdar://100890960

Differential Revision: https://reviews.llvm.org/D141868
2023-01-20 21:28:59 +00:00

22 lines
742 B
C++

// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s
#include "fixit-sys-header.h"
#include "fixit-user-header.h"
int main(int argc, char const *argv[])
{
char* str;{};
func_in_sys_header(str, str + 10);
// CHECK: Number FIX-ITs = 0
// CHECK-NEXT: candidate function not viable: no known conversion from 'char *' to 'unsigned long' for 2nd argument; dereference the argument with *
// CHECK-NEXT: Number FIX-ITs = 0
func_in_user_header(str, str + 10);
// CHECK: Number FIX-ITs = 0
// CHECK-NEXT: candidate function not viable: no known conversion from 'char *' to 'unsigned long' for 2nd argument; dereference the argument with *
// CHECK-NEXT: Number FIX-ITs = 2
return 0;
}