[ RUN ] IncludeFixerTest.UnresolvedNameAsSpecifier
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clangd\unittests\DiagnosticsTests.cpp(734): error: Value of: TU.build().getDiagnostics()
Expected: has 1 element and that element (Diag at 3:16-3:21 = [no member named 'scope' in namespace 'ns']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol ns::scope::X_Y])
Actual: { [3:16-3:21] no member named 'scope' in namespace 'ns' }, where the following matchers don't match any elements:
matcher #0: (Diag at 3:16-3:21 = [no member named 'scope' in namespace 'ns']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol ns::scope::X_Y])
and where the following elements don't match any matchers:
element #0: [3:16-3:21] no member named 'scope' in namespace 'ns'
[ RUN ] IncludeFixerTest.UnresolvedSpecifierWithSemaCorrection
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clangd\unittests\DiagnosticsTests.cpp(777): error: Value of: TU.build().getDiagnostics()
Expected: has 4 elements and there exists some permutation of elements such that:
element #0 (Diag at 4:2-4:8 = [use of undeclared identifier 'clangd'; did you mean 'clang'?]) and (is an object whose given field has 2 elements and there exists some permutation of elements such that:
element #0 is anything, and
element #1 Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol clang::clangd::X]), and
element #1 (Diag at 4:10-4:11 = [no type named 'X' in namespace 'clang']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol clang::clangd::X]), and
element #2 (Diag at 5:2-5:8 = [use of undeclared identifier 'clangd'; did you mean 'clang'?]) and (is an object whose given field has 2 elements and there exists some permutation of elements such that:
element #0 is anything, and
element #1 Fix 1:0-1:0 => "#include \"y.h\"\n" = [Add include "y.h" for symbol clang::clangd::ns::Y]), and
element #3 (Diag at 5:10-5:12 = [no member named 'ns' in namespace 'clang']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"y.h\"\n" = [Add include "y.h" for symbol clang::clangd::ns::Y])
Actual: { [4:2-4:8] use of undeclared identifier 'clangd', [5:2-5:8] use of undeclared identifier 'clangd' }, which has 2 elements
Running them with -fno-ms-compatibility makes them pass.
I'll add that for now to green up bots, but the tests are currently broken on Windows. fms-compatibility probably does something to Sema that the include fixer code doesn't expect. We need to figure out what that is and then make things work, else that part is broken on Windows.
Extended Description
From what I can tell they've been failing since they were added in Feb 2019.
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15918
[ RUN ] IncludeFixerTest.UnresolvedNameAsSpecifier
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clangd\unittests\DiagnosticsTests.cpp(734): error: Value of: TU.build().getDiagnostics()
Expected: has 1 element and that element (Diag at 3:16-3:21 = [no member named 'scope' in namespace 'ns']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol ns::scope::X_Y])
Actual: { [3:16-3:21] no member named 'scope' in namespace 'ns' }, where the following matchers don't match any elements:
matcher #0: (Diag at 3:16-3:21 = [no member named 'scope' in namespace 'ns']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol ns::scope::X_Y])
and where the following elements don't match any matchers:
element #0: [3:16-3:21] no member named 'scope' in namespace 'ns'
[ FAILED ] IncludeFixerTest.UnresolvedNameAsSpecifier (16 ms)
[ RUN ] IncludeFixerTest.UnresolvedSpecifierWithSemaCorrection
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clangd\unittests\DiagnosticsTests.cpp(777): error: Value of: TU.build().getDiagnostics()
Expected: has 4 elements and there exists some permutation of elements such that:
element #0 (Diag at 4:2-4:8 = [use of undeclared identifier 'clangd'; did you mean 'clang'?]) and (is an object whose given field has 2 elements and there exists some permutation of elements such that:
element #0 is anything, and
element #1 Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol clang::clangd::X]), and
element #1 (Diag at 4:10-4:11 = [no type named 'X' in namespace 'clang']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"x.h\"\n" = [Add include "x.h" for symbol clang::clangd::X]), and
element #2 (Diag at 5:2-5:8 = [use of undeclared identifier 'clangd'; did you mean 'clang'?]) and (is an object whose given field has 2 elements and there exists some permutation of elements such that:
element #0 is anything, and
element #1 Fix 1:0-1:0 => "#include \"y.h\"\n" = [Add include "y.h" for symbol clang::clangd::ns::Y]), and
element #3 (Diag at 5:10-5:12 = [no member named 'ns' in namespace 'clang']) and (is an object whose given field has 1 element that Fix 1:0-1:0 => "#include \"y.h\"\n" = [Add include "y.h" for symbol clang::clangd::ns::Y])
Actual: { [4:2-4:8] use of undeclared identifier 'clangd', [5:2-5:8] use of undeclared identifier 'clangd' }, which has 2 elements
[ FAILED ] IncludeFixerTest.UnresolvedSpecifierWithSemaCorrection (31 ms)
Running them with -fno-ms-compatibility makes them pass.
I'll add that for now to green up bots, but the tests are currently broken on Windows. fms-compatibility probably does something to Sema that the include fixer code doesn't expect. We need to figure out what that is and then make things work, else that part is broken on Windows.