Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clangd] PrerequisiteModulesTests Generating Unexpected Error when Scanning for Dependencies on macOS #124153

Open
qiongsiwu opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels

Comments

@qiongsiwu
Copy link
Contributor

clangd's PrerequisiteModulesTests are passing on macOS, but produces unexpected diagnostic errors. This is reproducible using commit bb6e94a05d15d289e3685c5599f0eb905dc46925.

For example

$ ./tools/clang/tools/extra/clangd/unittests/ClangdTests --gtest_filter="PrerequisiteModulesTests.*"                                                        
Note: Google Test filter = PrerequisiteModulesTests.*
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from PrerequisiteModulesTests
[ RUN      ] PrerequisiteModulesTests.NonModularTest
[       OK ] PrerequisiteModulesTests.NonModularTest (10 ms)
[ RUN      ] PrerequisiteModulesTests.ModuleWithoutDepTest
[       OK ] PrerequisiteModulesTests.ModuleWithoutDepTest (2 ms)
[ RUN      ] PrerequisiteModulesTests.ModuleWithDepTest
Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Ignored diagnostic. argument unused during compilation: '-c'
Built module N:Part to /var/folders/50/tcq20qrs2wj563qz76hymwlc0000gn/T/clangd/module_files/N-part.cppm2503448646646106135-79-eb-1a-03-e9-78/N-Part.pcm
Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Ignored diagnostic. argument unused during compilation: '-c'
Built module M to /var/folders/50/tcq20qrs2wj563qz76hymwlc0000gn/T/clangd/module_files/M.cppm5130802603315192334-a5-3f-5b-38-18-91/M.pcm
...

@ChuanqiXu9 pointed out that the errors should be fixed in clangd (#66462 (comment)) instead of updating the tests.

@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2025

@llvm/issue-subscribers-clangd

Author: Qiongsi Wu (qiongsiwu)

`clangd`'s `PrerequisiteModulesTests` are passing on macOS, but produces unexpected diagnostic errors. This is reproducible using commit `bb6e94a05d15d289e3685c5599f0eb905dc46925`.

For example

$ ./tools/clang/tools/extra/clangd/unittests/ClangdTests --gtest_filter="PrerequisiteModulesTests.*"                                                        
Note: Google Test filter = PrerequisiteModulesTests.*
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from PrerequisiteModulesTests
[ RUN      ] PrerequisiteModulesTests.NonModularTest
[       OK ] PrerequisiteModulesTests.NonModularTest (10 ms)
[ RUN      ] PrerequisiteModulesTests.ModuleWithoutDepTest
[       OK ] PrerequisiteModulesTests.ModuleWithoutDepTest (2 ms)
[ RUN      ] PrerequisiteModulesTests.ModuleWithDepTest
Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Ignored diagnostic. argument unused during compilation: '-c'
Built module N:Part to /var/folders/50/tcq20qrs2wj563qz76hymwlc0000gn/T/clangd/module_files/N-part.cppm2503448646646106135-79-eb-1a-03-e9-78/N-Part.pcm
Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Scanning modules dependencies for foo.h failed: error: invalid argument '-std=c++20' not allowed with 'C'

Ignored diagnostic. argument unused during compilation: '-c'
Built module M to /var/folders/50/tcq20qrs2wj563qz76hymwlc0000gn/T/clangd/module_files/M.cppm5130802603315192334-a5-3f-5b-38-18-91/M.pcm
...

@ChuanqiXu9 pointed out that the errors should be fixed in clangd (#66462 (comment)) instead of updating the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants