llvm / llvm/llvm-project

[clang-tidy] vfsoverlay matches filename somewhat arbitrarily with compilation database

Open
#182,526 4 comments 0 reactions 1 assignee Claimed by @vbvictor View on GitHub
clang-tidy
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The test custom-query-check.cpp creates a vfsoverlay with a file name main.cpp under the build directory, but if a compilation database is present (e.g. generated from CMake), clang-tidy will match any file name that is also named main.cpp for compilation flags. (We don't have many files with that name; to make this issue more obvious, use e.g. LLLexer.cpp.) In my opinion, if the path doesn't match, it shouldn't match the file for compilation flags; in any case, doing this with tests under the build directory is problematic.

Found while investigating build failures after #176420.

cc @HerrCai0907

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.