llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.12k stars 12.01k forks source link

Figure out why IncludeFixerTest.UnresolvedNameAsSpecifier, IncludeFixerTest.UnresolvedSpecifierWithSemaCorrection fail with -fms-compatibility #43007

Open nico opened 5 years ago

nico commented 5 years ago
Bugzilla Link 43662
Version unspecified
OS Windows NT
Blocks llvm/llvm-project#42937

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:

[ 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.

nico commented 5 years ago

Eric, could you take a look at this, since this is your test?

You can work on this on a non-Win bot by replacing the "-fno-ms-compatibility" flags I've added to the two tests with "-fms-compatibility".