Skip to content

Conversation

@ldionne
Copy link
Member

@ldionne ldionne commented Dec 10, 2025

Flags that should be used both for compiling and for linking are provided through the %{flags} substitution. Our clang-tidy tests should be using them, not only %{compile_flags}.

Flags that should be used both for compiling and for linking
are provided through the %{flags} substitution. Our clang-tidy
tests should be using them, not only %{compile_flags}.
@ldionne ldionne requested a review from a team as a code owner December 10, 2025 20:13
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

Flags that should be used both for compiling and for linking are provided through the %{flags} substitution. Our clang-tidy tests should be using them, not only %{compile_flags}.


Full diff: https://github.com/llvm/llvm-project/pull/171689.diff

1 Files Affected:

  • (modified) libcxx/test/libcxx/clang_tidy.gen.py (+1-1)
diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index 16c90c3ef7130..b46cc72c08dfd 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -27,7 +27,7 @@
 {lit_header_undeprecations.get(header, '')}
 
 // TODO: run clang-tidy with modules enabled once they are supported
-// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{compile_flags}} -fno-modules
+// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{flags}} %{{compile_flags}} -fno-modules
 
 #include <{header}>
 """)

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r origin/main...HEAD libcxx/test/libcxx/clang_tidy.gen.py

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from darker here.
--- clang_tidy.gen.py	2025-12-11 17:32:36.000000 +0000
+++ clang_tidy.gen.py	2025-12-11 17:34:07.500648 +0000
@@ -32,6 +32,7 @@
 // RUN:                    --config-file=%{{libcxx-dir}}/.clang-tidy                        \\
 // RUN:                    --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin  \\
 // RUN:                    -- -Wweak-vtables %{{flags}} %{{compile_flags}} -fno-modules
 
 #include <{header}>
-""")
+"""
+    )

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW IMO %{flags} is a bad name here. I expected %{compile_flags} to contain all flags that should be used when compiling, %{link_flags} to contain all flags that should be used when linking, and %{flags} to contain all flags that should be used when compiling and linking in one command.

@ldionne
Copy link
Member Author

ldionne commented Dec 11, 2025

FWIW IMO %{flags} is a bad name here. I expected %{compile_flags} to contain all flags that should be used when compiling, %{link_flags} to contain all flags that should be used when linking, and %{flags} to contain all flags that should be used when compiling and linking in one command.

Perhaps %{common_flags} would be a better name?

@philnik777
Copy link
Contributor

Yeah, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants